A more reliable way to check depexts, and a way to check dependencies

(we had --depends-on for reverse deps, but real deps :))
Closes #1418