updated sorting to be more robust and cleaned up some stuff in languages
Merge pull request #4585 from dimagi/drag-drop

updated sorting to be more robust and cleaned up some stuff in languages