code: function getMainDoc(db) {
    return getDocWithDefault(db, MAIN_DOC_ID, {}).then(function (doc) {
      if (!doc._attachments) {
        doc._attachments = {};
      }
      return doc;
    });
  }
docs: Store all attachments in a single doc. Since attachments
  are deduped, and unless the attachment metadata can't all fit
  in memory at once, there's no reason not to do this.