fixed handling of variables passed to template tags

- wrote tests for that
- refactored tests to reduce copypaste
Merge branch 'feature/ivw-szm-agof-tracking' into develop