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)
:+1: for the complete docs here!