Extend groupBy to handle non-equivalence relations.

Update DDocs.

Add unittest for 13595.
Use flag enum instead of bool.

To prevent Boolean Blindness.
Do reflexivity check in assert mode if predicate is claimed to be equivalence relation.
Use Flag instead of single-use enum.
Rename IsEquivRelation to EquivRelation.
Merge pull request #2654 from quickfur/issue13595b

Issue 13595: Extend groupBy to handle non-equivalence relations.