Frontend Refactoring

This PR also includes code of the new Javascript classes `SearchDownload` and `DownloadGenerationModal`
Why have you replaced the vars here?