Cosmology with the Square Kilometre Array