Start by a class Extension system from dinobuilder
class Extension
here is the example of the Scratch's extension coding:
function add_piece_of_system(system){ return system }