leveldb basic functionality code, adapted from abhishekkr/goshare