Simpler method to find the subclass name

In swanandp#123 the method used to get the class name seems quite convoluted. I've done some testing and found calling self.class works fine in this scenario. I've added some tests for this too.

Let me know if I've missed something. I've added tests too.

Memoising also doesn't seem necessary as the test suite runs just as fast without it.