rearrange & simplify system commands so they're portable to Windows (Thanks Antonio Sanchez)
Add new pathname_chdir for completeness