adding inital channel support for heartbeat
first stab at separating out commands
Merge pull request #23 from timkettering/master

heartbeat and separating out tasks into channels/goroutines (incomplete)