Create usertags using cached data
Description
This is a draft pull request for essentially enabling cache for the staff/Groups page, making the page reload very quickly even on a large course with hundreds of groups of tagged students.
Currently the template includes a (Django) tag which is resolved by a function that fetches all usertags for the course instance, essentially making the same database query for each group. While the Participants page uses the same logic, apparently the way Django arranges the db joins makes this page able to be cached properly, while the Groups page always needs to be queried again.
In this implementation, the tags are fetched once per page load and injected into the templates' "profile" tag using an "instance_usertags" tag. As the cachedStudent objects already contain a plaintext array of usertag slugs, we can use them to construct the usertags' html without performing a db query. In effect, this reduces the amount of queries (for a course with 2-person groups) from three to two per group when loading the Groups page for the first time, and from three to zero on subsequent loads (when students are cached).
On my test instance, a group page of 300 2-person groups, a reload of the page created 909 queries and took 4.8-4.9 seconds, while the cache-enabling code created 11 queries and took 0.9 seconds (measured with django-silk). Tests were ran on Docker with cache running on the same machine in a memcached docker image with the memory option of "-m 1024" (1024 MB).
This implementation includes a lot of repeated code for all view classes showing usertags, and therefore should probably be refactored before deploying. Formal tests have also not been ran.