Stepwise homebrew installation

Installs homebrew the way their installer script would do it, avoiding things like failures if the target directory already has contents. This is particularly useful for setting `$installdir` to `/usr/local`.

See [homebrew/install](https://github.com/Homebrew/install) for details.