Shadow the built in tmpdir fixture to use our Path object

* Uses the same generation method as the built in tmpdir, simply
  returns a different object type.
Refactor tests.lib into classes that can be used to modify state
Use our classes from tests.lib.* in pytest fixtures
Replace explicit calls to reset_env() with the script fixture