libtorc-core: Fix host field for IPv6 in websocket upgrade requests.
libtorc-core: use 'localhost' for loopback IP address literals.

- which, if nothing else, works around a Safari websocket bug which
fails to parse IPv6 websocket addresses (though it will still fail for
non-local IPv6 addresses).
libtorc-core: Add some more javascript static variables.