Made Material a real polymorphic class.
Small formatting fix.
Merge pull request #452 from est77/polymorphic_materials

Made Material a real polymorphic class.
small code cleanups.