Rewrite parse_cartridges metapkg logic

Updated `parse_cartridges` metapkg logic to rely on the resolved value
of `pkgs`

Rewrote `metapkgs_optional` and `metapkgs_recommended` to not use `grep`