Added connection error handling for all send / recv related methods so that we can reconnect on all connection errors
Added an event queue so that emitted events that failed can be automatically retried upon reconnection. Also fixed a potential infinite loop bug wrt reconnecting automatically
Fixed a typo bug. Also added better disconnect handling in the websockets send method
Added tests that verify restart functionality is working as expected