Remove hard-coded dependency on 'localhost' as a server.

Now the JS looks to the current hostname and expects a server there at port 9001.