Factor out common code in ajax.js

* Make a common GiddyUp.fetch() function that wraps all the previous
  logic.
* Prevent multiple enqueued fetches of the same resource, attaching
  additional callbacks as necessary.
* Use the same function for indexing by ID.