Only run auto-update .travis.yml code for first travis job.
Move autoupdate logic to separate shell file, fix autoupdate logic so travis-lint passes and small refactor of .travis.yml generation.