Generates the AST to sort maps as per sort specs (ascending/descending keys)
Generates a sort function from a list of sort specs