Introduce hook_page_section_is_empty() to determine if a page_section is empty and move existing logic to a hook implementation