This nest of for loops and if statements is repeated a number of times and is kind of ugly.  I want to factor it out into some kind of `iter_mtype_listeners` or something, if I understand correctly what this is doing.

Actually it could also be simplified a bit to something like:
```
for mtype in msubs:
    for key in self._mtype2ids.get(mtype, {}):
        ...
```