Whitelist packages with names matching those specified before generating rules

Addresses #2690 doesn't do any performance optimisations yet which we
could do now
Add tests for the changes in #2690
Properly limit to name matches only if necessary
Resolve job packages after whitelist generation
Merge pull request #2733 from naderman/limit-replace-provide

Whitelist packages with names matching those specified before generating rules