Remove lingering <p> elements. Add heading IDs.