move XMLHttpRequest detection to bundling step

Doing environment detection in the source is messy and always
done in strange and different ways. Instead, we educate the bundler about files
which should be replaced during bundling. As long as these files adhere
to the same API, the code that uses them can remain the same allowing
for greater code clarity and reuse. The xmlhttprequest module has this
"education" baked into it in the form of the "browser" field.