Cleanup #10601: Move static dyntabmenu code in external file