Manually unhook router heartbeat on disconnect, since this is the only part of the simulation we still set up on connect.  Also extract common disconnect code.
Manually unhook router heartbeat on disconnect, since this is the only part of the simulation we still set up on connect.  Also extract common disconnect code.

rvarshney/code-dot-org,pickettd/code-dot-org,pickettd/code-dot-org,dillia23/code-dot-org,ty-po/code-dot-org,ty-po/code-dot-org,ty-po/code-dot-org,ty-po/code-dot-org,ty-po/code-dot-org,rvarshney/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,ty-po/code-dot-org,dillia23/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org,dillia23/code-dot-org,ty-po/code-dot-org,dillia23/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,rvarshney/code-dot-org,dillia23/code-dot-org,rvarshney/code-dot-org,pickettd/code-dot-org,rvarshney/code-dot-org,ty-po/code-dot-org,dillia23/code-dot-org,pickettd/code-dot-org