Using shlex to sanitize dowmload_handler()
Almost complete refactoring using classes