improved mockXHR.js with JSLint