* moved to levelup
 * more error handling
 * handle dirs for leveldb