Fix directory changes in test to restore to original directory on teardown

Closes #56