Update to XCode 4.6

Some code cleanup. Still a number of deprecations to fix.