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.
Merge pull request #15 from elerch/master

Support for unit test mocking of XMLHttpRequest