Remove unnecessary $http variable
[BUGFIX] Properly cache resource writes

... so that they still happen on a page refresh.

There were a couple of bugs here, notably we weren't saving the "action"
for the request, and we were expecting the request's deferred object to
still be around. (The deferred object will only exist for requests made
after the current page was loaded)