[applets/appmenu] Spaghetti of fixes
Still managing not to nuke things smh
Here I addressed all the problems raised in !1340 (merged) (except for semicolons), and extra ensured everything still works fine as intended.
There are no particular bug fixes — only general minor refactoring. Ping me if you want to be further split across different merge requests.