Matt-Esch/virtual-dom — pull request #149 by Matt-Esch (2014-12-21 03:14:36+00:00)
Title: Fix destroy ordering

Fixes clear state so that it:

### always appends patches to the patch list

Not appending the patch assuming a destroy is the only required operation creates bugs in the widget case, as a replace and destroy are required

### appends the destroy statements to the end of the patch list

Removing the original DOM node from the DOM breaks subsequent references to patches that depend on `parentNode`. In this particular example, the replace operation was coming after the destroy operation, and replace depends on `parentNode.replaceNode`