Add tear down function

There is like 0 way in hell you can test this. But trust me - it's needed! We are backing up the factory variables but then not restoring them after the test to the way they are