Package lookup API

This defines a package lookup API: cockpit.packages.lookup()

This contains a lot the cleanup in preparation for AMD loader branch as well.