Expose getTempDir() and the memoized return value.
Added basic tests of getTempDir.