Added support for Homebrew Cask and better OS checking.