WIP: Group by entity (tests and domain)

TODO: Rendering