basic support for stdio sessions, SSH sessions disabled, minor bugfixes and refactoring