Make legend on Special:RecentChanges and Special:Watchlist collapsible

Some of the code added here is duplicated, redundant or would be
better off placed somewhere else. I know about this, but this is not
the time to fix that (and nobody would review such patches anyway…).

Bug: 52005
Change-Id: I02f2ced42f33649b6c972d35a4739372ca265e10
Merge "Make legend on Special:RecentChanges and Special:Watchlist collapsible"