Emit teardown event before replacing generated content node content and emit setup event after.

Change-Id: I397d4dfb5fd0177255a0b4389ba5380807969ef4
Merge "Emit teardown event before replacing generated content node content and emit setup event after."