Add a decent amount of OSX support

Most of this just consists of little compiler tricks (header file
differences, some C++ const char C interfacing, etc).  There's also a
big hack in there because OSX's pkg-config doesn't appear to work
properly for a reasonable subset of packages that are installed by
default from Apple.  This is a pain, and I hope they fix this... :).