Cleanups regarding temporary files in tests

Delete index files for temp files at the end of testing, and
do not write temp files within source directory.
Merge pull request #127 from bpow/testing-fixes

Prevent testing from leaving extra files around