TODO: reconnectOnClose, should it take optional object code+handler? Using onError as default
SPEC: onMessage WIP...
TODO: Redo error handling!!
GSocket: Minor edits for better unit testing. Fixed retry criteria for tries/maxtries
SPEC: onError WIP. sendHeartbeat WIP.
GSocket: Do not queue heartbeats...
SPEC: sendHandshake WIP...