Change some components to levelup from noDB

Way too much code duplication in the added lib/* files. Also need to
move sessions away from noDB.