Report joined state when replying to join request.
Implemented heart beats. Fixes #1.