Override equals and hashcode in Module to use identifier.

Also made identifier read only.