Automatic escaping is now done at the end.

Now if the associated modifier is not present at the end, it is simply added behind the scenes (in a mode where it escapes for all contexts).

This is more consistent, logical, since the final output is ensured to be escaped This is the safest solution. It also greatly simplifies the code.

Tests have been refactored, and additional modifiers have been tested.