Fixes a memory leak.

fixes #666 by registering the nodeList to be removed when the parent element is torn down