session manager restructuring

Redid the sessionmanager, added tests for the session manager,
and added a sqlite database to hold kernel,session,nb mapping.