Extract XcodeVersion to be a standalone module function

The _XcodeVersion from XcodeSettings class does not need to be a member
function as it does not use any of the field of the class. Extract it
to be a standalone function at the module level, and all the functions
it calls (that also don't use fields from XcodeSettings).

Keep the _XcodeVersion wrapper function that keeps a cache of the
values returned from Xcode to not degrade performance for clients of
the old API that may depends on that cache.

BUG=None
R=mark@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/148783005

git-svn-id: http://gyp.googlecode.com/svn/trunk@1849 78cadc50-ecff-11dd-a971-7dbc132099af
Improve ninja's Xcode emulation

When cloning the target dictionaries for "iphoneos", correctly filter
the ARCHS value to only include value that apply to the SDK (iphoneos
or iphonesimulator).

Take into consideration the VALID_ARCHS filter if defined and support
the $(ARCHS_STANDARD) and $(ARCHS_STANDARD_INCLUDING_64_BIT) defaults
from Xcode 5.0.

If ARCHS is not set (which is the default for most of the projects)
then result will be identical, but it can now be set to the macro
$(ARCHS_STANDARD_INCLUDING_64_BIT) to build correctly for arm64 and
armv7 with both ninja and Xcode (including xcodebuild).

Update test/ios/gyptest-archs.py to test build for both simulator
and device, with different configuration (no ARCHS and filter that
only keep 32-bit platforms, explicit ARCHS with filters for 32-bit
or 64-bit platforms, and explicit ARCHS with no filter). This breaks
the test with the "make" generator as its support for Xcode emulation
is inexistant.

BUG=http://crbug.com/339477
R=justincohen@chromium.org, mark@chromium.org, thakist@chromium.org

Review URL: https://codereview.chromium.org/138533006

git-svn-id: http://gyp.googlecode.com/svn/trunk@1850 78cadc50-ecff-11dd-a971-7dbc132099af