ENH: Add generic dialog template utilities