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/
Merge pull request #1418 from sgrif/sg-cache-travis

Cache apt and gem installs on travis