Update for iOS 7, 64Bit and clean up code