Restructure code so client doesn't have a cgo/leveldb dep