Lighting tweaks + material caching and reloading

This implements a shared material cache and in-game material reloading from material files, and also addresses the lighting issues discussed in #60.