Clear build stuff before test runs.
Fixed unit tests.
Factored out duplicate code.