This has the advantage that pointers to panel declarations remain valid
after most panel API functions. This is important for python scripting
where a panel is referenced by pointer internally.
Instead of just an index, we now use the category_id to specify the
category of a socket as well as associating a panel with a category.
This has two consequences:
1. No need to remap indices after adding/removing/moving a category.
Flip side is that finding the category of a socket now requires a
linear search. In future this could be more efficient using a map,
but that is a separate task.
2. Now the panel open/closed state bits are associated with a stable
identifier, so panels will retain their state when moving.
Adds an optional list of "categories" to node trees. Each socket can be
assigned a category. Sub-panels will be created in the future for these
categories (TODO).
Sockets of the same category will remain together even when adding,
removing, or moving sockets or categories, renaming, etc.
A socket can be moved up or down within a category but each category
remains a contiguous block. Actual tree views may be created later.