Support for unit test mocking of XMLHttpRequest

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