Minor optimization to FFP emulation: Use integers instead of strings as key to FFP matrix file. This allows using arrays instead of maps to store the file, and avoids unnecessary string operations.
Optimize GL FFP emulation layer by omitting redundant glUseProgram for identical shader programs.
Optimize glEnableClientState by avoiding it to be called with different param count.
Optimize glBindBuffer when GL emulation modes are not used. In that case, currently bound buffers do not need to be tracked.
Make caching of last bound GL_ARRAY_BUFFER in FFP emulation mode safe and always enable that optimization.
Simplify verbose object dereference chains in GL library by consistently using the global name GLImmediate over the GL.immediate form.
Simplify verbose object dereference hierarchy in library_gl.js by storing global WebGL context in the variable GLctx in addition to Module.ctx.
Simplify GL emulation matrix stack initialization. Update code after rebase.
Rename GLImmediate.matrix.lib to GLImmediate.matrixLib to not alias with GLImmediate.matrix array that contains emulated modelview,projection and texture matrices. Restore compressedTexImage2D symbols to be closure-friendly.
Add var GLctx; declaration to GL init to avoid polluting global namespace. Replace all 'this.xxx' with 'GLImmediate.xxx' when this==GLImmediate, to avoid throwing off Closure minification pass.
Fix preprocessor ifdef in GL emulation library.
Merge pull request #1972 from juj/gl__opts

GL cleanup and optimizations.