added globalScope handling so object-factory can also be used in Web Worker's global scope