Test refactoring to get better coverage for leveldb backend
Refactoring tests to support leveldb better, part 2.