factoring and docs
docs and simplification
refactor setElements with extra target position argument
improve setElements range checking
optimising dense array copying