A first proposal for the implementation of group by and count (still needs something to test it).