Better cleanup of temporary files in tests

Not sure I've squashed them all, but this is a start
@charleso This is actually not ok sorry, the implementations of delete all need to change in some situations - this is now leaving files on s3.