Test that React loads properly in a web worker

This should catch top-level uses of `window` and `document`, while lint rules catch `global`. (Also fix these problems so the new test passes.)

I felt like I was doing hacky stuff the whole time I wrote this, so this is probably not the best way. Suggestions appreciated. (Guessing this won't jibe too well with FB internal testing either.)