Refactoring session handling
Merge pull request #21 from wagnert/0.5.8-beta

Refactoring session handling