Add groupBy to List

I missed the functionality to easily group the elements of a given list. 

Since I'm a beginner in functional programming, please let me know if this is already implemented in another way and unnecessary.

Cheers, Martin