Add equals/hashCode to APIs, and deprecate groupBy.

equals/hashCode are useful for debugging/verifying/testing,
and the groupBy implementation is naive. It'll be replaced
by a groupBy implementation in Analysis that will handle
external/internal dep transitions correction.

Feel free to close the other pull request and merge this one, to keep your git history clean.