Use realize package specifier

The goal here is to clean up the special cases around local package handling and put it all in a module so I can use it outside of cache (for multi-stage install)
I have no idea, I just copied over and ported the npa tests.