This new code is much more verbose. Could you instead add an optional argument to setupProgram, console, which will make the calls internally to addShaderSources if it's present?