Test cleanup: Use temp files for output

Now, tests can be run in parallel. They are kind of slow because they
just sleep a lot!