Fix up being able to call "to_dict" on classes to see if they have a function for converting the object to a dict