File and directory stubbing

Adds `stub_dir` and `stub_file` to create a temporary directory or file that
will be removed after the tests finish.

It also supports giving a name, which might be used when a test needs a 
explicit directory or filename.