Fix building and running on OS X

This is an initial patchset for building for OS X; it doesn't include proper packaging of the scripts into the app bundle nor including redistributable Qt frameworks in the bundle, but is enough for running the gui app within the built source tree at least (for testing hexamonkey).