Implement Sort in GetTask

#16
This P/R is a superset of #177 since I did a lot of restructuring in that PR

Relevant files for Sorting is just comparator.h, comparator.cpp, internal/action/get_task.h, internal/action/get_task.cpp