More usable version

The events are now triggered with the correct context (like jQuery-ui's sortable).
Make it work on any element type (tested on tables).
Add more tests.