Converted @with_session into @create_session. This now works on an
object, and the API is a class again. @create_session creates a session
object and assigns it to a session member variable, and sets it back to
None once it's done.