Improve performance of `brew cask list`

Fixes #1416.

Few of the included changes are specific to `brew cask list`.  Perf will be
improved for various other operations as well.