Fix appendChild and appendTo to move elements instead of duplicate them