Bug 858402:  Intermittent tests/test-xhr.testLocalXhr | Timed out

Added addEventListener and removeEventListener methods to sdk/net/xhr and used a load event listener to check if the request cleaned up itself, instead of using a setTimout.

Also cleaned up the test-xhr.js file to use the new test framework.

The setTimeout was either not firing soon enough or it was firing too soon.