Only add mapping if it doesn't already exist.

Also moves MATERIALS constant into super class, and uses it there.