Added equals and hashCode definition for math instances

Added to classes that might be kept in a collection as well as added
hashCode to classes already overriding equals