Fixes icon, added @grant & clean up code

This PR fixes the icon from not showing again.
Also adds the required `@grant` metadata.
And cleans up some code.