OpenGL (and various) improvements

I've rebased my changes so they make more sense.