cleaned up and fixed a lot of OpenGL context code.