Finished material_name() function and accompanying unittest.  Needs documentation.