It would be much cooler to transform `{Bucket, {IndexTerm, Key}}` into `{{Bucket, Key}, IndexTerm}`, because then the map phase function would get the `IndexTerm` as its `KeyData` argument. Depending on representation, that might break Javascript phases, though.