added insertBefore and fixed parentNode on insert/remove