Use more pytest fixtures

Use pytest `tmpdir` across the board rather than `tempfile`

Closes #130