Some test helper functions.

Switching the process dir is kind of gross. Is there a reason it's needed that wouldn't be covered by adding the working dir to subprocess calls?