Bug mw eunit test cleanup

Able to run the unit tests, meaning refactoring can be done more safely.