Fix Mac version bugs and restructure the Xcode project.