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.
Line is too long. [86/80]