Adding heartbeat, on socket close code and close reason, and refactoring code to use WebSocket enums

Adding heartbeat to the Phoenix JS socket
Allowing for closing code and closing reason to be passed to the web socket connection as mentioned here http://tools.ietf.org/html/rfc6455#section-7.4.1
Refactoring to use enums instead of hard coded values for connection status
I prefer having the `Ms` suffix on the field names it means I don't have to look somewhere else (i.e. documentation or source code) to understand what units these values should have.