XDnD implementation from Davey Taylor, need some cleanup