Reintroduce CGP refactor.

Fix several issues that caused crashes.
Remove glsl in shader_parse.

It'll be done slightly different later.
Merge branch 'cgp-refactor2'