Add init and deinit callbacks to GL canvas, plus other refinements.

Ignore-this: 1822595c127c281c92bfb178fbf64f4d

darcs-hash:20141001223354-4d2ae-abaee5d26ac73c13c005b4fbb321caf9b235720e