Moved mock mongodb logic to test directory.