Add StringRef X_init support for Linux

Requires testing!
Update calls to setlocale()

Calls to the C library's setlocale function have been changed to more appropriate values. Previously, they were setting the LC_CTYPE and LC_COLLATE to the default system locales (as specified, e.g, through the $LANG or $LC_ALL environment variables) when what they really wanted to do was set them to the US English settings with the native encoding (Codepage 1252 for Windows, ISO-8859-1 for Linux and MacRoman for OSX). The other locale settings are set to the system default (this includes C library error messages, numerical formatting and time/dat formatting).