for-each-ref: avoid printing each element directly to stdout
for-each-ref: use format_commit_message as the main formatter

This brings a whole lot more format specifiers to "for-each-ref
--format". The most interesting are coloring and alignment
specifiers. It comes with shortcomings too as the two formats are
designed separately.

Dead functions are left in place to avoid cluttering the diffs. They
will be removed separately.
for-each-ref: remove dead functions
for-each-ref: introduce format specifier %>(*) and %<(*)

pretty placeholders %>(N) and %<(N) require a user provided width N,
which makes sense because the commit chain could be really long and
the user only needs to look at a few at the top, going to the end just
to calculate the best width wastes CPU cycles and makes Git feel slow.

for-each-ref is different. The display set is small, and we display
them all at once. We even support sorting, which goes through all
display items anyway. This patch introduces new %>(*) and %<(*), which
are supposed to be followed immediately by %(something) (i.e. original
for-each-ref specifiers, not ones coming from pretty.c). They
calculate the best width for the %(something), ignoring ansi escape
sequences if any.