Clean websockets

Resolves the #1 crash on Crittercism by buffering socket writes while a socket is reconnecting. Also *way* cleaner code hopefully allowing us to move to a proper websocket lib.
this is just a whitespace change, right? Was it intentional?