Prototype

Fixes seg-fault and race condition problems in erroneous GL calls,
patches renderer, and ensures that the window will dispose properly and
terminate the engine when closed.