Improve homebrew and other command detection.