Optimizing criteria expansion/collapsing

For issue https://github.com/MarkUsProject/Markus/issues/916.

Instead of doing AJAX calls, do do client-side JavaScript to expand/collapse the criteria.
Ignoring for style.