Testing Gravity with Cosmology: Unlocking the secrets of cosmic acceleration