Update homebrew installation package

Checking "which homebrew_package_name" did not work for things like
bash-completion, which is not a shell command, or vim and emacs that
already are installed on the system, but not yet with homebrew.

This new method checks against the list of packages installed with
homebrew.