Windows support

This makes a few changes necessary for Windows support to work properly.  Tested on one Windows system so far.