change isequal to return false for numbers of different types. fixes #3385
also updates hash() accordingly
generally, fewer and simpler definitions are needed.