Major improvments

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