Lots of OpenGL refactors
Like the name of the branch says, this was originally meant about fixing render time tracking for !4833 (merged), but some OpenGL stuff got in the way, so I started refactoring it... And it's quite a lot. It might be sensible to wait for a week or two before merging this, to not make cherry-picks more complicated.
For details, check the individual commits, but overall this MR moves all the static OpenGl related things into the context objects. The only functional-ish change is that fbos are now hard required for compositing - I tried to keep everything else the same as it was before, including X11-only stuff (which we can get rid of more safely once the code base is split)