split out sort funciton until multiple lines for better stacktrace
Merge pull request #1388 from dimagi/export-app-sorting

split out sort funciton until multiple lines for better stacktrace