add test/test.js from joanuno/cea08ac040ad012fecec95cf202d87fc055fbecb

Add a test to check the indexes of node and model children are in sync.
small fix to keep node and model arrays in sync