what happens if the leveldb.write(batch, ...) call fails? withBatch should probably accept a success and a failure thunk, and send Written only if that write call acually did its job. Btw, is leveldb.write synchronous?