Use the Windows pathname manipulation routines to robustly implement this on Windows. Fixes issue #30.