Added Material class and completed Resources class.
Fixed lots of stuff.