fix #1073 Missing datepicker/calendar test case

No test was done by opening the calendar and clicking on a date.
This one checks it
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.

Closes #1077
1.5.1
fix 1076 onblur called too often by MAC

onblur custom event is called every time an element inside the MAC is blurred.
Same thing happens for the onfocus custom event.