Better snapping and more encapsulation

Detecting snaps function has more sane behavior now. Previously it would
default to snapping to the parent if the object below the point didn't
have the snap property set. Now it looks underneath. Performance takes a
hit when you call it repeatedly.
Also, html data-___ attributes are now correctly uniquely named.