Updated logic to write the plan code or subplan code from catalog entries (depending on if it's a program or specialization object) and then loop back through and add the plan code to items that only had a subplan code. This then allows us to accurately match subplans to their catalog entries.
Enhancements: