Reimplement 'groupby' using 'collections.default'
Reimplement 'frequencies' using 'collections.Counter'