Improve order of productions in grammar.

Put each production below the production(s) in which they are used,
and in the order in which they are referred to.