Rewrote code to rely on glfw; further cleaning of rendering code