Improve MessageContext to also handle more complex message markup

Some themes or modules (e.g. https://www.drupal.org/project/absolute_messages) create markup for messages that outputs the individual messages in individual containers that are specific to the message type (status, warning or error). This PR enhances the asserts so that each of those containers will be checked for the given message. As multiple functions have to be going through the same loops I have created two new private functions that are called with parameters from all the asserts so that the same code gets re-used.