Fix wrong threaded usage of OpenGL context.

This fixes crashes on all platform when rendering to the screen.
Actually pass QGLFormat to QGLWidget

GGLWidgetInternal wasn't passing the format it received to the parent
constructor, meaning the format wasn't used at all. This make the Qt UI
properly initialize a 3.2 context.
Merge branch 'opengl-crash'
Replace GLEW with a glLoadGen loader.

This should fix the GL loading errors that occur in some drivers due to
the use of deprecated functions by GLEW. Side benefits are more accurate
auto-completion (deprecated function and symbols don't exist) and faster
pointer loading (less entrypoints to load). In addition it removes an
external library depency, simplifying the build system a bit and
eliminating one set of binary libraries for Windows.
Update GLFW to 3.0.4 and include x64 lib for MSVC
CMake cleanup

Several cleanups to the buildsystem:
 - Do better factoring of common libs between platforms.
 - Add support to building on Windows.
 - Remove Qt4 support.
 - Re-sort file lists and add missing headers.
Avoid LOGGING redefinition warnings.