Initial refactoring of the filesystem code/parser