Added filename sanitization and files are now saved to folders.