Work around a syntax highlighter issue
Removing trailing whitespace
Completely rewrite parser

The new focus is to define the syntax completely in terms of list//3.
This makes the code more concise and consistent.

I could have removed much more code from this commit but decided to keep
the generic DCG predicates because they're likely to be helpful in the
future (or should be factored out to a library).