Fix #1677 slow K*(N+1) query madness on the Edit Package page!

Fixes #1677. Edit package metadata page slooooow.