Found and fixed memory corruption bug in model manager.
Separated window and render context creation into separate classes.