Flaws with Renderer, GLProgram and gl state management

@ricardo, the static indices are causing a crash, please see my post here: