Add merge, partition and groupBy methods to Relation.

Also add equals/hashCode to Relation.

Also add a basic test for groupBy.
Merge remote-tracking branch 'benjy/relation' into 0.13