Refactoring and bug fix (for lower-level sections) for xref-pagenum-style template.
Merge branch 'xref-pagenum-style'