Merge pull request #447 from ndawe/master

[MRG] io.file refactoring and handle special cases in cd_previous