Refactored and added functionality to the glfw window implementation.