Major improvements

Need this to make optipng work correctly on Windows.

* Windows support
* Consistent code style
* Better documentation

cc @ameyp