LMDB implementation code copy/paste/modified into the Berkeley DB implementation. Need to test if it builds, then if it works, and so on, but the code is all there.