for-each-ref: rename some functions and make them public
Rename some of the functions and make them publicly available.
This is a preparatory step for moving code from 'for-each-ref'
to 'ref-filter' to make meaningful, targeted services available to
other commands via public APIs.
Rename 'struct ref_sort' to 'struct ref_sorting' in this context.
Based-on-patch-by: Jeff King <redacted> Mentored-by: Christian Couder <redacted> Mentored-by: Matthieu Moy <redacted> Signed-off-by: Karthik Nayak <redacted> Reviewed-by: Matthieu Moy <redacted> Signed-off-by: Junio C Hamano <redacted>