new TravisEnv type added with some cleanup
refactoring of build code alongwith using TravisEnv type
new helper functions addded for type TravisEnv
refactoring and fixup of some functions