Better cleanup of temporary files in tests

Not sure I've squashed them all, but this is a start
They should be using, `TemporaryLocationDir`, but I am ok to leave this as a catch-all.