Update elements_parser.js

slicing one by one, doesn't make the array bigger. so the index value is still effective.
If you slice by 0 the array grows up and so index loose meaning.
Merge pull request #3 from asturur/fix-ordering-of-the-pieces

Update elements_parser.js