Massaging the build process

Preparing ground for further work on build scripts.
All right. I'm spending too much time on this anyway. Reverting.