Makefile and docs: add EXCLUDE_PKGS and show*deps* functionality

Adds dependency traversal that runs in linear time, so things like:
```sh
make EXCLUDE_PKGS='foo bar'
make show-deps-foo
make show-upstream-deps-foo
make show-downstream-deps-foo
```
work as expected.