test/storage: Rewrite tests to use mock XHR

Previously these tests relied on us using $.ajax({...}) within the
storage. These tests should now be largely implementation-independent
(as the XMLHttpRequest API is mostly consistent between supported
browsers).