fixes potential XSS issue with TOTP exception lists (which need escaping, see also #1185). refactors Template escaping to use TemplateEscape enum (rather than the previous boolean). thanks @TrapoSAMA