Substantial refactoring of Shape code.

Beginnings of ReverseShader implementation.