mostly fix Issue 7151 - [CTFE] cannot compare classes with ==

Essentially, copy the implementation of opEquals into object.di.
Comparison of TypeInfo objects still doesn't work. Seems to be a dmd
issue.

This feels pretty trivial for an issue that's been open so long. Am I missing something?

I'm not sure if I put the test in the proper location.

https://issues.dlang.org/show_bug.cgi?id=7151
Unfortunately this is not good. CTFE and runtime result should be consistent, but this code breaks that assumption.