refactor `brew cask cleanup`

Divide into more tractable methods. No functional change.

Change apparent typo in test regular expression
detect cached downloads in doctor

and recommend "brew cask cleanup" if present.

Closes #4857