Working towards 1:1 file handling

More changes
Revert f4efbaa..f111211

This rolls back to commit f4efbaa639339baee1f08e11422b5e4124e1408a.