Add sort argument to tally. Closes #182