Refactoring of setenv template
Merge pull request #32 from fdammeke/master

setenv.sh fixes