Xcode 5 / OS X 10.9 Compatibility

This is based on the work by @seebs from moai/moai-dev#796, thank you! I just went for a different fix for the curl issue.