Adding 'dir' param to allow user to specify a directory for files to...

...go in, but still get a random file name.

Confirmed tests pass on Python 2.7 and 3.3.