Update to latest web-socket-js and fix compatibility.

* Update to latest web-socket-js.
* Fix compatibility with web-socket-js.
* Update to use native JSON methods.
* Make policy URL customizable.
* Add "close" method.