gbr: make 'command' pluggable
gbr: do branch_re matching outside the command function

Branch matching (filtering) is useful for --when too, so pull it
out from dump_branch() and into gbr_branch_foreach()

The gbr_branch_foreach() gets a prototype change so struct dump_context
is already typed at that time, instead of being the opaque closure
it used to be (originating from libgit2-provided git_branch_foreach()
which no longer exists.
rudimentary support for gbr --age (show last commit age)

There's no sorting here yet, but it now dumps the commit date
of the latest commit in every branch.

For --age we don't dump upstream information, because it's costly
and this is useful on its own too.

...which also means this is becoming a swiss knife of random
functionality.
post-iteration cleanup hooks

Provide a ->cleanup() helper in struct dump_context that, if
present, will be called after all the branches have been iterated.

A command can set a cleanup function for getting rid of its
private data (or doing some sort of command-specific print

--age will use this to free the tree used for sorting, shortly
age: pass full gbr_dump_context to private helpers

We'll be storing the branch tree in gbr_dump_context, so we want
that available when doing things.
move branch name printing inside the command functions

'age()' will soon want to print the branch name(s) at cleanup()
time, as it will sort them first.
age: print commit date before branch name, skip unixtime

strftime("%c") has a fixed-widthish nature, so printing that
before the branch name gives us nicer formatting.
age: prepare dump_date for being walked by the tree walker

A simple signature change to helper methods; dump_{,commit}_date()
now takes a git_repository *, instead of the full context.
age: trivial newline printing move inside dump_date()

dump_date() will be the entry point for the tree-iterator
callbacks so we need the newline there.
print branches most-recently-changed first when --age is passed

Instead of printing branches during branch iteration, collect
them in a binary tree keyed by most recent commit date.

We then print the branches after iteration, most recently changed
branch first.
Merge branch 'branch-age'

Support for gbr --age: print local branches most recently changed first.