Implement window closing

-Pulled inspiration from http://www.glfw.org/documentation.html