Move WGL_state to window procedure, and a number of improvements in that direction.