Fix the check for orphaned pages in the docs, minor cleanup.
Add section headings to the programming guide page.