New shader system

Well that was a lot of work. But the material system is so much more flexible now. Merging this so people can test it. My next task will be documentation.