Only write the git head ref file after the export is complete -
that's only when we commit the gitcommit-ids as well, so at the next
export monotone wouldn't take the intermediate head well.
Do not go through all the revisions and select based on branch cert,
but instead get graph only of revisions reachable from chosen
branch's head - not all of those have the branch cert.
Move string_to_datetime() from commands.cc to transforms.cc and make
it public. And while at it, use it when decoding author-time cert
while exporting to git.