Introduce count_by with a secondary field

I've re-used "count_by" the expression because there isn't ambiguity, but happy to give it a different name too if people prefer.
Happy to use call-by-name on `getOrElse` instead, but this seems a little faster (crazy town?)