Move escape() into Template