move all EbookDoc handling into Doc
header dependency reduction