Reindented script and rewrote event triggering.

New events are as following:
- onconnecting: WebSocket initialized, now connecting to the host.
- onwaitingforinitialping: WebSocket connected but waiting for InitialPingMessage so we can definitely send data.
- onopen: WebSocket connected and got initial ping
- onclose: WebSocket disconnected
- onerror: WebSocket errored (error attached as parameter)
- onauthenticated: Authentication done, we now have a GUID (given as parameter) etc.
- onmessagereceived: Got a message from the server, it's attached as parameter.
- onmessagesend: Sent a message to the server, it's attached as parameter.
- on<lowercase message name here>: Triggered for the specific message type received from server. Triggered after onmessagereceived. Message body attached as parameter.

Events still need to be defined from outside using PlatformSocket.onevent = function...
Merge branch 'master' of github.com:DreamNetwork/Node-DreamNetwork