support qname sorting, and destroy leveldb when done