Fix unit test build

Fixes all the tests that are currently failing, and makes the default build fail if unit tests don't pass.