Reintegration

Commits from integration branch without agent/worker communication refactoring and tests
Why is this dead code here?