Add an initialisation method called each time a LoopPrimitive is started.

Suggestion for allowing user to run some code when a loop primitive is started.

This code has been tested, it seems to work well, however I'm not really satisfied by the method's name.