Partial changes toward windows support.

The current code continues to work on mac.
I am guessing it still works on ubuntu, although I haven't tested it
lately.
It does *not* work on windows yet (doesn't even compile), but my hope is
that it won't take much more work for that to happen.