Kunal says the notification formatter is inflexible and should be rewritten. It relies too much on messages to format things, it doesn't allow for flexibility in what its "payload" is, and there are a lot of little things that make it difficult to write correct code.
For example, you have to use $this->language if it's set, or $wgLang is not, but there's no getter wrapping this for you. If you do this wrong, then when a French-speaking user does something that causes a German-speaking user to be notified, (part of) the notification will be in French instead of in German.
Also, the $wgEchoNotifications description format is difficult to understand, and the formatting code depends on this global state.