Cleaned up new OpenGL state management code