Add DirectorySwitch class to manage chdir stack