Added special case for command cd which uses chdir to change directory.
Merged