Added thread support (and tested) and migrated from GLFW 2.7 to 3.1