Changing CWD when using -C and -e

Primarily opening this as a pull request so that Travis can run the tests. The code should otherwise be ready for a merge to master.