Refactor insert/materialize node schemas.

Also, BTW, I've played around with templates parameterized by enums and found that I prefer templates parameterized by dummy classes -- one per "value" -- mostly because the C++ mangled symbols for template instantiations remain much more readable with class parameters than with enum parameters (that compile away into cryptic integer constant parameters).