Switch to use matchdep

No point in duplicating logic.

Fixes #10
Fixes #5, closes #13
Fixes #7, closes #9