Convert session.coffee to session.js
Merging in session.js changes