Broke heartbeat code into multiple chunks.

This is just a quick refactor to make the existing code a bit more comprehensible.

@bernerdschaefer 
```go
func monitorRunningContainer(
	client *client,
	c *Container,
	heartbeat *agent.Heartbeat,
) {
	// ...
}
```
Best to put the multi-line declaration this way; and transitionc can be set up in the monitor function.