The tensor-vector-scalar theory and its cosmology