FileStat -> Stat; minor refactorings