Used detach() instead of empty() so event handlers would stay in place.

Props go to @whatthejeff for finding this. This fixes #50
Merge pull request #1 from mospired/patch-1

Used detach() instead of empty() so event handlers would stay in place.