#7 refactor main loop to use a channel to signal an error in order to exit
#7 reply to heartbeat message
#7 register endpoint locally upon receiving any message
Merge pull request #10 from tryge/master

Fixes #7 Endpoint Identification