Refactor Travis build scripts