Use enumerated type for direction in leveldb

Also updates others.

Breaks leveldb tests.