Refactor insert/materialize node schemas.

I like your idea.  I wasn't terribly comfortable with that line of code.