Change ESPError API to support ESPError(string message)

ESPError was supposed to be invoked with a boolean argument 'log' and
return an exception class (either ESPError_Log or ESPError_NoLog), as
in:
    raise ESPError(False), 'message'

But this is a counterintuitive API, and there are places in the code
that try to use it with a string argument, as in:
    raise ESPError('message')

This fails to do the right thing. This second usage is more consistent
with other exception classes, so it should become the default.

This commit changes ESPError to allow the second usage, while still
supporting the first usage if ESPError receives a null or boolean
argument for backward compatibility.
Update occurrences of ESPError to the new API

See commit d589fe1.
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
Merge pull request #1037 from learning-unlimited/esperror

Change ESPError API to support ESPError(string message)
Merge branch 'main' into mit-prod