Will reinstate after https://github.com/discourse/discourse/pull/25905 which is failing because of this spec not being compatible with the changes.
This commit updates the plugin to the latest guidelines, as shown in discourse-plugin-skeleton, which involves moving a lot of the code to dedicated files, use proper namespaces, use the autoloader as much as possible, etc.