Have event in menu factory to be more flexible how menu nodes are converted to menu items

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #170
| License       | MIT
| Doc PR        | TODO

Rebased and squashed #170 and did some cleanup.