Threaded Connections added, Session refactoring, protocol fixes