[js] types arrays: factor out array index accessor functions from obj code. externalize for use in copy constructor
[js] typed arrays: add copy constructor
[js] types arrays: add copy constructor test