Primary category changes

Adds support for primary_category_parent_id field and improves handling
of primary categories. Previously if a primary category was set then
the same ‘normal’ category was not also set. This fixes that from a UI
and code perspective.