Use std::unordered_map for "materials"

Use auto for some variables