Fix calculation of descendants in dj.Table

Dependency levels were calculated correctly but duplicates
were eliminated without considering their level. We now
pick the entry with the highest level.