Making the new semantics of #3691 optional.
To enable it, one has to set ENABLE_EXPLICT_MATCH_REQUIREMENTS=true.

Also improve the handling of string maipulation.