Refactor travis setup so that we can easily test it outside travis.