Updated the build scripts.
Added more tests and increased code coverage.

Removed some areas of dead code.