Convert to using a CLI class

This makes a lot of code simpler through memoization and not having to
pass Logger instances everywhere.