Respect $TMPDIR and $TEMP environment variables, closes #7