calculate appropriate prefix size and start using group instead of facet
for now this makes the output worse, and crashes when too many prefixes are
needed, but its a start in the right direction