Use multiple HTML files for ebook generation

Fix #467, #458, #447, #412