Implement pings to server, handle pongs from server

If no events are received in 115 seconds, a ping is sent to the server and the "pong" reply is handled. Need to implement reconnection if no pong is received within n seconds.