Created DocumentSorter class and translated tests for it from Python code.