Coordination and Composition in Multi-agent Systems