See #266. Try to avoid phantomjs's odd module wrapping, which clobbers the global context