More cleanup in session hook
Made new session support in core interpreter work without the dirty hacks.