Build mac apps + distribution.

A bunch of small changes, but the big one here is that we now generate
the mac app from scratch, using the plist creation code that was
checked in earlier.