Implement PreQL GROUP operation using metis consensus clustering

Merge as soon as tests pass