C89 and windows fixes

Worky on windows, tests pass. Ping me to build the next release.