crazy hacks to get both node and browser tests working

I have some more ideas to make this less crappy, but out of time for now.