improved output file names (ported fix from qiime's pycogent backports) and gives user control over temp file location