clean up code around session and identity map

introduced idea of null session and null identity map