merge _G.class and NULL related functions to _G.metatable
metatable refactoring