Various fixes to category, categorymatch, and categoryregexp.  This fixes issues with them either not working or not assembling the logical operators in the correct orders.