Fixes the following bugs:

- global leak caused by using 'this' inside a callback, while
  expecting it to be something it is not.
- missing 'else' caused bug where a second callback may be called
  after the first returns.
Add unit test for request.js