OpenGL 3.1 Rendering for gles backend

Todo
* Break into gl31 rendering module, with a nice way to re-use code
* support both gles and gl31 (?) on platforms that support both, or provide make config
* rewrite all of the gl related code to be less retarded