Implement GroupBy LINQ operator