Adds categories and status to class flags search.

For convenience.  There is no secret plot to make the class flag query
builder the Class Query Interface To End All Class Query Interfaces.
Also makes some code less repetitive.  Also adds
Program.open_class_registration to (cachedly) check whether the program
is using open class registration (which is a field on the CRMI).
Fixes css bug on flag pages with admin toolbar.
Various small tweaks and fixes to class flags.
Allows adding class flags from the query results page.
Add "show all" and "hide all" buttons to flag results.
Makes minor fix to flag query builder JS for readability.
Makes minor fix to flag query builder JS for readability, correctly this time.
Merge pull request #1048 from learning-unlimited/class-flags

Class flags fixes and additions