General cleanup of the CoreFoundation framework.

I silenced unnecessary warnings (sometimes by setting compiler flags and sometimes by #defining away non-existent functions).