Reintegration

Commits from integration branch without agent/worker communication refactoring and tests
Fix the formatting here