This fixes std::string conversion to and from spider monkey strings.
JS Strings are always 'wide'. They are stored either as Latin-1 with a 'wide' hack, or as proper UTF16.
This is incorrectly handled by the std::string conversion code, which can result in broken string conversions.
Adds tests to fix the broken cases.
Uplifted from D2814