Gl tex formats simplification

Fixes #3039 and refactors the GL texture enum handling code to simplify it. Also fixes wrong hex number on GL_RG (it is 0x8277 instead of 0x8227) and simplifies glReadPixels to use the same machinery.
That's right, they don't - UNSIGNED_INT_24_8_WEBGL, GL_UNSIGNED_SHORT_5_5_5_1 and the likes encode their own fixed size.