added format-patch to git interface
fixed doctests
correct order of headers in git patches
added export_patch

I'm currently testing if the patch bot is happy with the format that
header_format="hg-export",path_format="old" produces.