scheduler: use agent.Events() in the state machine

Also, update the Events API to yield ContainerInstances as a map type.
That's so we can get nice partial-update semantics in the state machine
mutation method.