Refactoring the travis scripts to allow easier extension.

Copyright and licence?