changed connection management and got Idle/Sync working
added some documentation