Added tests for grouped aggregations. Fixes #7