Fix equality to not use extend.

This can totally kill performance. Brought up by @jamesgolick

What do you think, @haines ? You wrote this code originally.

I have a feeling that something might be off, but the tests all pass, so... ?