Upraged version of the build script an repo cleanup

Hi

I'd like to thank you for the great work you've done with the build script. Your work motivated me to participate and "upgrade" the script a bit. I added improved parameter handling and renamed some stuff. I hope you like it and consider to pull my changes into your repo.

Best wishes,

Felix