script: Pass the correct parent node to pre_insert in insertBefore

Closes #1572.
Add a test file for insertBefore
auto merge of #1621 : abustany/servo/fix-insert-before, r=Ms2ger

Closes issue #1572