Fix up type equality/hashing.

    Now more things that should be equal will compare or
    hash as equal.
Overflowing an signed value is undefined. Use uintptr_t.
Actually check subtypes in structs.