Material: allow custom id & do checks by id

This allows you do things were you may need to have separate material instances that should be treated as if they were identical.

When running in node.js, you don't have the same kind of globals, and so it is necessary for sanity to do something like having a `module.exports.material = new Material(300)` in, say, `Ship.js` that can be checked via id, because a new version is made each time it is imported. 
(this is primarily so that you can sanely set up ContactMaterials between entities defined in different files)