fix(tests): DRY up more code and update test folders

Make some of the code more DRYer.
Update the tests to all use the temp folder instead of folders outside
of it