Work on build system. Thanks to cpw for most of the code
Merge remote-tracking branch 'origin'