Vastly improved performance of casting to self.

Casting to self now costs less than a dynamic_cast<> call.
Improved benchmark accuracy.