Refactor material model.
Work on restoring TraceDemo to its former glory.