Added unit test to model integrity and refactored legacy test suite.