Clean up, add description of methods and move the class filemanager in its own file.