Assign funcs to (window || global) to work in node