Replace hardcoded /tmp references with Dir.mktmpdir.

* Closes #141