Refactored the db so that data is stored both on disk and in memory.
Made some methods synchronous (namely, the method that opens the database)
in order to simplify the code. Added new tests for the new code.