Removed global variables use for single modules. Added $core global
(thx Pontiggia for all the precious hints)