Simpler method to find the subclass name

Also added tests
Merge pull request #139 from swanandp/simple_class_name

Simpler method to find the subclass name