This is to support adding a template for type selection.

It also clean up the type_field generation a little.  Only add the current card's type if it isn't already there.  Then we don't need unique and we only have to sort if we are adding one.