Unicode I/O on Windows

This pull request enables passing Unicode into `$argv` on Windows systems; and makes Unicode output work in all situations. Currently, all characters in command line arguments are converted to platform encoding by Windows before passing them to `php.exe`. We trick around this by [encoding](http://en.wikipedia.org/wiki/UTF-7) the command line arguments. Also, regular PHP output in a Windows console window would be garbled, see below; so this is circumvented by passing all output through the C# runners.

![garbled-output](https://f.cloud.github.com/assets/696742/1567408/a4839146-509d-11e3-8896-555450f226d8.png)

Because we break BC, we change the entry point from `tools/(class|web).php` to `tools/(class|web)-main.php`. These entry points are optionally checked, and a graceful degradation to the old entry points and the old behavior exists.

See also xp-framework/rfc#146

* * *

Showing off behaviour in a Windows console:

![xp-output-unicode-regardless-of-codepage](https://f.cloud.github.com/assets/696742/1567424/eef01240-509d-11e3-9d75-92cf71859937.png)

...and in a Cygwin mintty (here, plain old PHP also works fine for the output, but argument passing is still broken):

![xp-output-unicode-cygwin](https://f.cloud.github.com/assets/696742/1567429/f737dea6-509d-11e3-92f3-e7aa8972c28f.png)

* * * 

Requires the following diff in tools/class-main.php:

```diff
diff --git a/tools/class-main.php b/tools/class-main.php
index 727e3a3..b2b0061 100755
--- a/tools/class-main.php
+++ b/tools/class-main.php
@@ -50,13 +50,23 @@ bootstrap(
 );
 uses('util.cmd.ParamString', 'util.cmd.Console');

+// Start I/O layers
+$encoding= get_cfg_var('encoding');
+iconv_set_encoding('internal_encoding', xp::ENCODING);
+array_shift($_SERVER['argv']);
+array_shift($argv);
+if ($encoding) {
+  foreach ($argv as $i => $val) {
+    $_SERVER['argv'][$i]= $argv[$i]= iconv($encoding, xp::ENCODING, $val);
+  }
+}
+
 ini_set('error_prepend_string', EPREPEND_IDENTIFIER);
 set_exception_handler('__except');
-#ob_start('__output');
+ob_start('__output');

-array_shift($_SERVER['argv']);
 try {
-  exit(\lang\XPClass::forName($argv[1])->getMethod('main')->invoke(null, array(array_slice($argv, 2))));
+  exit(\lang\XPClass::forName($argv[0])->getMethod('main')->invoke(null, array(array_slice($argv, 1))));
 } catch (\lang\SystemExit $e) {
   if ($message= $e->getMessage()) echo $message, "\n";
   exit($e->getCode());
```