Support for XMLHttpRequest mocking libraries

Rather than capturing and reusing the window.XMLHttpRequest at
the time of load, XMLHttpRequest will instantiate a new window.XMLHttpRequest object at run time.  This allows
mocking frameworks (e.g. sinon.js) to temporarily mock the object
in unit tests.