Merge pull request #50 from DrMarcII/master

Improved closing behavior, add support for connecting to existing sessions.