Add temporary DB class and write some tests for it