Capitalize and add anchors to headers in grammar.dd

Combined with #497, this makes grammar sections easily referable.

I also took the liberty of capitalizing the section headers.