fix some namespace pollution and globals leakage
update typedarray shim