Use if let syntax for Dictionary {group, count}by

Didn't realize Dictionary had the same methods to clean up! Almost amended my pull request before it got through, here you go!

This uses the same idiomatic if let syntax for the Dictionary
versions of groupBy and countBy, as well as removing a few
unnecessary semi-colons.