clean up support for --filter-deps + add unit tests

@pescobar: rather than making remarks in https://github.com/hpcugent/easybuild-framework/pull/957, I tackled any remarks I had myself; if you merge this in, it should be ready for merging in (hopefully in time for EasyBuild v1.14.0)