Optimisations.

Mostly to do with disabling OpenGL error checks and caching of state
changes.