generalize menu roles determination
make prefs running correctly from global menu

TODO: make it possible to run Preferences without a Main Window