craftyjs/Crafty — pull request #727 by starwed (2014-02-07 22:07:04+00:00)
Title: Reorganize init/removal of DOM component

DOM wasn't really cleaning up after itself. This moves all the logic to the special `remove` function, and unbinds all the events properly. To unbind them, the event handlers are now _methods of the DOM component.

There was an also an issue where undraw would throw when the entity's element wasn't actually attached directly to the stage. It's now just removed from its parentNode.

A related issue was reported [in the forum](https://groups.google.com/forum/?fromgroups#!topic/craftyjs/nl6OngFj5eA)