Fix initialization of viewportTransform array
Add unit tests
JSDoc tweaks
Just do `slice()` for cloning
Merge pull request #1495 from Kienz/issue1494

Fix initialization of viewportTransform array