Changed chdir to cd for changing directories

`chdir` is the C command for changing directories (from `unistd.h`). Most unix shells alias this command to `cd`, but some don't - for example RHEL. This pull request replaces the use of `chdir` with `cd`.