flashproxy.js: Begin support for running under node.js

With this minimal patch, node.js can start to run a flashproxy -- it
connects to a facilitator, gets a client address and attempts to make
a websocket connection to it.  The websocket connection doesn't
complete, and I'm still working on figuring out where the problem is.

To use:

$ sudo apt-get install nodejs npm
$ cd flashproxy/proxy
$ npm install websocket-client xmlhttprequest
$ node flashproxy.js

Signed-off-by: Arlo Breault <arlolra@gmail.com>
Hoist variable declarations.
Assume browser env when testing in Rhino.

API compatibility issues with Node.js cause flashproxy-test.js to fail.
Use ws instead of websocket-client.
Add a package.json file.

Simpler to setup; just npm install. Also consider publishing to the registry.
Use ready state constants from the constructor.

These aren't inheritable properties in ws.
Use binary frames by default in node.
Callbacks only return data in ws implementation.
Ws doesn't implement bufferedAmount.

Conditionally use it in the browser.
Revert "Ws doesn't implement bufferedAmount."

This reverts commit 4110c0f96273259b162d33ee3a7ed7542d0294c6.
use ws fork until patch merged upstream
some ifdef cleanup
Revert "use ws fork until patch merged upstream"

This reverts commit 343bbfc15dde1c1775dfffc24d8f7cb376c5978c.
add workarounds for bufferedAmount and binary frames
comments to watch for upstream merges