Replace deprecated methods, and move to Xcode 5.