Installed packageids

I think this is now ok to merge.

See previous discussion in #1470