flatten group not followed by a project (Fixes #422)

- and fixed the schema in groupBy
- and moved the RenderTree[Grouped] instance to the correct companion obj.