Migrate most of the code to GLFW3. Some errors and warnings remains. Runtime execution is bad.