[WIP] [#1078] package_show performance improvements

Comments requested. These changes aren't perfect, lots of tests are failing, but I'm sure they can be fixed with a little help. I would like feedback on the changes below before proceeding.

Performance numbers so far, taking best of 10 runs for each:

option | time(s) | improvement
--- | ---: | ---:
original | 0.074 | 1.0x
53a4e5c | 0.038 | 1.9x
973bb8c | 0.015 | 4.9x
f2a4822 | 0.009 | 8.2x