Cosmology with CMB-S4