CORE: add sort
CORE: add sort-by, update specs for sort.