Cygwin support, tmpdir refactor, unix.splitdir drops trailing slashes like dirname