Drag and drop items and groups

Have you guys tried implementing something where you drag an item and drop it on another item to form a group? Also to reorder items including groups around? How did you do it?