more file io refactoring

Removes more references to static working directory.

@osa1 @radumereuta Please review
What happened here?
I think this is worth a revert to preserve the change to a minimum. Could make tracing the original author easier.