more file io refactoring

Removes more references to static working directory.

@osa1 @radumereuta Please review
This injection is wrong. I will follow up with comments when I have the reason why.