Group by support

Group by support added (mockable)