Split the modularity patch into smaller pieces. Add global directives used by some plugins
Also add common methods of different modules.

Change-Id: I2104da7b5df21d35b4f22ddf7eab7b72c5493b03
Signed-off-by: Maxime Millette-Coulombe <mmcoulombe@inocybe.com>