Allow test frameworks to mock out XMLHttpRequest

- instead of saving a reference to global.XMLHttpRequest / ActiveX,
  return the reference each time http.request() is called
- performance impact should be negligible
- potential concerns about malicious injected scripts hijacking
  XMLHttpRequest... considering jQuery initializes XHR() the same way,
  it shouldn't be an issue.
- normalized some semicolon usage