I've been wondering: do we really want to take the current application state (e.g. bgLayer) into account when creating links for the context menu popup? And, as a user, if I open a context menu popup and then change the background layer without closing the popup, should the links in the popup be changed (new bgLayer value)?