Remove lingering <p> elements. Add heading IDs.

These fail to show up in the output, I believe.