scheduler, agent: major refactor

- State machine in scheduler now respects the fact that mutations may
  occur in the agents from other, outside forces.

- agent.Client as a HTTP front to a remote agent.

- Helpers and miscellaneous improvements.