Refactor dragging into dragging and positioning.

Before draggable had positioning logic that could be reused elsewhere, so I split it out.