Fix URL bug in JS, and adds some documentation

Now the JS will open up a websocket to the host of your page, instead of
hardcoding in localhost:90001.

There is now documentation for the local server API, so it's easier to
build tools on top of it. The documentation needs to be cleaned up a
bit, as does the API itself, but this is just getting the basics out
there.