Higher spin cosmology