This diff mainly focuses on generalizing the object creation, destroying and accessing process of the instruction objects while executing the user's code.
Previously, the object creation and destroying code for both didn't follow the same process/behaviour. In this diff, the code have been refactored to have same behaviour and the other changes which are very important for the extension for programmingMaze loops activity.
Now we maintain two look-up tables for main and procedure respectively and we create the instructions for each at the starting of the levels and they can be accessed to execute the instruction when needed, and destroyed at the end of the level (which was previously done only for procedure).
This is certainly better, more readible, and most importantly having the code to follow the same behaviour for both.