Add prerelease and major version support to build script