Merge pull request #786 from hdeadman/tempdir
Allow working directory to be configurable via globals (instead of always using /tmp)