Fix build with the 10.7 and 10.8 SDKs.

The changes required were quite minimal, but while I was at it I moved all the backwards compatibility declarations into a separate file to reduce clutter.