Renderer: Fixed shader lighting model, optimization in shader
generation logic + fix for dangling texture references.