build.sh: change the versioning variables around, general cleanup of script