ShaderFactory:  Factorise to one functions that generates all programs.

Passing a type to the generate function of the shader factory will return
the initialzed program and reused identical shaders.