Modify cfg-parser's treatment of error function so it can consume both arity-3 and arity-5 error functions.

Meant to match the interface provided by parser-tools/yacc's parser.
Add documentation for cfg-parser.