Heartbeats

Fixes #32 by using client-side ping's. In addition to that, it fixes a reconnect bug.