Fixed material access issues in storage and renderer

More work needs to be done in model.cpp: For some odd reason, the
memory in "mat.shader" seems to get corrupted, resulting in a weird id
being returned. Investigation: activate!