Reintegration

Commits from integration branch without agent/worker communication refactoring and tests
If you call connect multiple times. Won't this create too many connections?