new function: packagesmatching

Very similar to `classesmatching`.

Takes a regex.  Returns the matching lines from the package cache in format "package,version,arch,manager".  I will write docs if it's accepted.

Issues:

* I don't know how to trigger the package discovery from policy
* (probably related) can't get the acceptance test to work

Advice and help welcome.