Refactoring in support for multiple simultaneous gl contexts