xhr: Wrote tests for xhr.js

- [ ] @davestein