Aggregate tests now passes. Moved various unit test code that ran on import into setup and teardown functions that are called at the appropriate time when run with other tests.