refactor the leveldb engine, supports scalable schema