lots of refactoring

only one functionality change -- removed Win32 compatibility mode from catdir that handled volumes instead of dirs

mostly reducing the number of regexes and calls to canonpath