Use SIZE_T where appropriate, added a simpler helper parsing function.
Fixed msvc, mingw build, removed dependency on winsock2.