bind global context for buildin setImmediate/clearImmediate and small code refactoring