[book] tidy chapter when regenerating it

 * Remove a chapter if it contains no sections
 * Remove sections which are not present in the chapter
Merge pull request #231 from jnavila/book_tidy_chapters

[book] tidy chapter when regenerating it