General refactoring, clean-up, FileManager class implemented