Automatically detect ping timeouts and reconnect. Assume pings happen at least every 5 minutes
Clean up escaping a bit, hopefully doesn't break everything