Prevent modules from creating global variables

Modules shouldn't create global variables.
This patch make all global variables local