Mostly the same logic applies, with a different rank.
Additionally expose the logic to do identify contraction dimensions and
contraction-like bodies as independent transform ops. This allows us to
recognize "generic" operations and not only the named ones.
Rework the contraction body matching logic to no longer rely on
contraction operations beign uniquely named.