OpenGL-backed renderer (plus some refactoring)