Changed to duck typing for name detection

If the input data has a name attribute, use it for a label if one is
not slready set.