Get rid of anyEqEq and anyRefEqEq and optimize them (a bit).

First, this is closer to what the JVM backend does. Second, it
allows the optimizer to optimize at least the anyRefEqEq case.
anyEqEq is still to do.