Add fallback when targetEntity is undefined

If field description's targetEntity property is missing, the name is guessed using the old method, which is to remove the last 's' from the property's name. Otherwise, the correct name is guessed using the classname deduced from the namespace.