Feature/reduce function signatures

Two variables are passed through most functions so I moved them up to the `exports` scope.

Doing this also revealed that the `writeFileData` method was the only operation of the statFile function, so I called `writeData` directly.

Then this showed that the writing to the file happened each iteration of the `recurse` handler so I moved it outside of `writeFileData`