Cache apt and gem installs on travis

We spend a lot of time in each travis run installing gems and apt
packages. We can speed this up a lot by caching them.
http://docs.travis-ci.com/user/caching/