Refactored the OS X script for better readability and to enable builds on newer versions.

Issues resolved:

- Added support for the 10.8 (Mountain Lion) and 10.9 (Mavericks) SDKs.
- Dropped universal builds on 10.8 or higher, x86 is not supported anymore.
- Use clang instead of gcc on 10.8 or higher. Fixes a system header compilation error on 10.9.
- Fixed issue with the libjawt path on certain JDKs.