Refactored unit tests. Still in need of major reworking.