Merge pull request #97 from goranche/master

Changed creation of a temporary file, it now prefers mktemp, but will use tempfile if used. if all else fails, it creates a temp file in /tmp