Make it work in node.js as well as browser

Also make sure tests get run in both environments.
I'd love to see this alone in its own package. Or even a whole package of nothing but node browser interop.