My original plan here was to combine all built-in GLSL snippets into one built-in JavaScript object at compile time (as opposed to separate objects for functions, structs, and constants), and then add the automatic uniforms to it at load time so that the object mapped from all built-in GLSL identifiers to their code snippet.  This would allow constants to depend on structs and so on.  I haven't looked at the implementation yet, but I imagine it would be clean.