Add API for package queries

It would be very handy to query for installed packages. That should take in to consideration not only installed name but also Provide.