Implemented graceful closing of the GLFW window, along with emulation.

Also, can this be made const?