Reintegration

Commits from integration branch without agent/worker communication refactoring and tests
not sure if we want to return or just break.