Move functions handling files to own module.
Check for callback before calling it.
Use settings manager to share settings between modules.
Make sure that single files always are displayed.