Add facility for controlling the OpenGL context.

Ignore-this: 8fcc12d8506e8ec7d1055d2a1a508295

darcs-hash:20141207233051-4d2ae-d54b2079f73325235ee840e5911cdd5fa7c80b87