Move heartbeating out of Agent

1. Removing more time-oriented functionality from the Agent makes it easier to test
2. An Agent does not control the whole Machine, since the Engine is tied to it as well

The job-heartbeating functionality needs to be moved out of the Agent as well.