Merge Xcode 6.1 changes to master

Includes safer use of arrays (which don't seem to be fully threadsafe) by using withUnsafeMutableBufferPointer and some other updates.