improved assigning of stubs to work in browser+nodejs + strict/non-strict mode
simplified new solution