Add cache and sudo configuration for faster build on Travis CI

I have changed .travis.yml for faster build on Travis CI according to [Faster Builds with Container-Based Infrastructure and Docker](http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/)