Factor out mark filtering/sorting for use in _dumpMarks()
Merge pull request #5150 from adobe/nj/mark-sort-cleanup

Factor out mark filtering/sorting for use in _dumpMarks()