Lots of improvements to the build process.

This gets things building against all our target platforms and also
implements tests to ensure the code runs on each build and that the
package can be successfully installed for each platform.