Update flag_form alter and template_validate to use flag_types table.