code: function compactTree(metadata) {
    var revs = [];
    traverseRevTree(metadata.rev_tree, function (isLeaf, pos,
                                                 revHash, ctx, opts) {
      if (opts.status === 'available' && !isLeaf) {
        revs.push(pos + '-' + revHash);
        opts.status = 'missing';
      }
    });
    return revs;
  }
docs: compact a tree by marking its non-leafs as missing, and return a list of revs to delete