This reverts commit 052844f5e13c71ceefd743136a71f71226a0eefb. 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