added version attribute, renamed and moved session.js, inline documentation