Rules template: support AllowHosts and DenyHosts. Refs #2752
Policy template: avoid duplicate policies. Refs #2714
Rules template: move AllowHosts and DenyHosts before regular rules. Refs #2752