Adding questionable mktmpdir function; part of #196.