export: split cmdutil.export() to single-file and maybe-multiple-files cases
Porting "hg export" to formatter is a bit hard because cmdutil.export() may
append to files if the fntemplate is specified. This patch splits the hard
part from the trivial case.
export: do not start pager if output will be written to file
A copy of
3b569745af6c.
formatter: carry opts to file-based formatters by basefm
This makes it slightly easier to port "hg export" to formatter.