This reverts commit 052844f5e1. There is a bug in ->remove() that causes the parser to incorrectly identify elements in the DOM tree that shouldn't exist anymore. References #1151
052844f5e1