Implement test setup and teardown

Will be reused for the core tests