* Make some renames in the session module - avoid having a function called 'delete'
so that we don't piss any C++ compilers. Also rename the {startup,shutdown}_globals
to {startup,shutdown}_session_globals, so that they're a bit less general names,
and made them static.
* Remove uselss variables