Windows support. Builds cleanly with msys+mingw x64, though I neeed to patch the mtest progs. Will try to get this change upstreamed.