Style and cleanup in session.js.
Fix #9