Basic Session Support

Plus bug fixes and more consistent syntax.