Refactoring for new session handling
Merge pull request #25 from wagnert/master

Refactoring for new session handling