added unit tests for leveldb writer