Improved the build system, now building at least. Tests are failing