Fix compound member extractions in equality checks
Use == in compound.equals(), rather than ===

This makes things more intuitive for programmers, and also makes the
future behaviour of hashCode() easier to understand.
Add the hashCode() method to all types

These builtin methods calculate hash codes that conform with equals();
i.e. if a.equals(b), then a.hashCode() == b.hashCode()