more file io refactoring

Removes more references to static working directory.

@osa1 @radumereuta Please review
@osa1? I didn't write this, as you can see it was already there.