Allow categories to be specified in mid-tree

Before, categories had to be leaf nodes.  This stunning reversal changes
everything.