Updates test setup and teardown to flush module registry after test runs