Path and filehandle fixes for Win32 compatibility

The following changes get all testcases to pass on ActiveState perl on Win32-x64

The changes are to open all file handles in "raw" mode, and to join path parts with "/" when creating URI fragments.