Port to Windows

Changes:

* Use `gyp` to replace the `configure` script for building.
* Fix multi-byte string counting on Windows.