Move global variables to src/global_vars.c and add g_ prefix for them