Chdir changes the current working directory to the named directory and
registers a cleanup function on the provided `t` to restore working directory
to its initial value once the test completes.
CreateFile creates or updates the given `file` in the given `dir` with the
given `content` and registers a cleanup function on the provided `t` to
remove the file once the test completes.