Add a function for lazy chdir.