[ALLI-2704] Resurrected encodeAmpersands as it is used in some customized templates.