This is along the same lines as the previous commit, with the same caveat.
The way submenus are handled here isn't really right, since they can come and go at runtime, but I've left it like this for now. A side-effect is that we can't use gtk_widget_class_set_accessible_type here, but have to override get_accessible.