Dynamical systems in cosmology