disconnect db/client on exit, use json encoding
disconnect on SIGINT and SIGTERM
set up sublevel dbs