travis/build script refactoring and slight cleanup