code: function createDocumentLoader(promise) {
      return function(url, callback) {
        promise(url).then(
          // success
          function(remoteDocument) {
            callback(null, remoteDocument);
          },
          // failure
          callback
        );
      };
    }
docs: converts a load document promise callback to a node-style callback