Select dependents when a extant component is selected.

The original pull request is #630. I clean some files and create a new branch. 

When a extant component is selected, all its dependents are highlighted by different color. If it's deleted, the dependents are also deleted.

Fixes #507