Added ClassName::fromObject method and companion test case.

Yes. I added it as a dependency because it's a dependency. :new_moon_with_face: