more file io refactoring

Removes more references to static working directory.

@osa1 @radumereuta Please review
@radumereuta see #1127 .