Port over to incompatible API introduced in 2.4

This enables the applet to load in Cinnamon 2.4, although I expect it to break in <= 2.2 by the same token. Code changes are taken directly from the upstream menu, with not much cleverness applied.