Implement group_by and aggregations