Moved struct material_s to material.cpp

Plus some minor cleanup.