Fix issues 8435, 10118.

The problem was that BigInt didn't declare toHash, and BigInt's typeinfo wasn't using the custom version of opCmp instead of the default bitwise opCmp.