Moved common file into core library. It's mostly used for tests.