Clean up material API

One function with 14 arguments is now much more flexible and stable,
being split up into many functions. See test.lua for an example of how
the code is laid out now. Was a bit painful to get working because of
some derping I had while moving the icosahedron drawing code into
shape.c.