bug 833579 - Use insertBefore instead of appendChild r=Etienne

https://bugzilla.mozilla.org/show_bug.cgi?id=833579