EMI: Share all loaded materials within an EMI costume

This is needed because sprites and texi components need to share the same materials. This will make it so that each material in a Costume will only have one copy for that costume. There could be issues with this if one Costume needs to use one material in two ways, but I find that doubtful.

The part in resources.cpp is what I'm concerned about. Right now it's just some emi specific code that is not marked as such. Because of where _cost(maybe I should rename that) is set the if (_cost) parts can never be used by grim.

Thoughts?