Add methods .merge and .makegroups
Merge pull request #4787 from paulmasson/patch-1

Add methods .merge and .makeGroups