Improved Xcode4/5 support, improved loader, install routine, code cleanup.

Please see commit for notes.