Tests for template context handling improvements

* Contexts whose names have been replaced should
  not get deleted even if no identifier inside it was matched
* This allows us to separate the replacement step from the context handling step
Better handling of Maps in Template

Associative arrays and instances of stdClass can now be given as
parameters to replaceIdentifier or replaceIdentifierMultiple and identifiers
of type {{type.property}} will be replaced.

Also the handling of identifier contexts is more consistent than before:

 * Contexts aren’t removed when an identifier whose name they refer to
   has been replaced but is not inside the context boundaries.
 * replaceIdentifierMultiple internally makes the same call as regular replaceIdentifier