Fix 4 issues

This PR covers all OS X Mavericks issues that I've recently discovered in my testing on a clean Mavericks install. (And reinstall to test idempotence.)

Here's an install log for the [first install on a clean Mavericks](https://gist.github.com/gohanlon/d0e694667ad5e15cfba1) and a the [second install](https://gist.github.com/gohanlon/2cf6a178831c54e2d484) to show idempotence.
@mike-burns Before I get to far I'd like to note that, while admittedly not elegant, this `awk` expression does work for all of the 3,000+ stable formulae in the main repository.

We could use `cut`, but there're two different delimiters that need to be consumed: `,` and the space character. I don't think it's possible to use a single `cut` command to consume multiple delimeters, and I didn't find the `cut` expressions I came up with any more obvious or any easier to read. Here are five representative outputs from `brew info FORMULA_NAME | head -1` in case you see something I'm missing (very possible!):

    ack: stable 2.12
    hub: stable 1.12.2, HEAD
    faac: stable 1.28 (bottled)
    redis: stable 2.8.13 (bottled), HEAD
    postgresql: stable 9.3.4 (bottled), devel 9.4beta1

I believe the approach in this PR, including the `awk` statement, is already a substantial improvement. Ideally, I'd like to see the PR merged and then open an issue to describe and discuss potential improvements to clarity, robustness and a couple non-trivial edge cases that're still unaddressed: support for managing head and head-only formulae. (The handling of these two cases will likely see this `awk` expression superseded.)