Move WStringToString() and GetErrorString() from PluginAPI.cpp to better places allowing reuse.
Fix Windows Unicode TODO in PluginAPI.