Optimize custom syntax rules

Previously all custom syntax rules were tried one after the other
with full rollback (via `try`). Now they are tried one after the other
but with a minimal rollback.

Introduces datatype SyntaxRules which contains a list of rules and
4 "precomputed" parsers (expr/simpleExpr * term/pattern). Every time
new syntax rule is introduced parsers are rebuilt. Expression parsers
use an appropriate parser.

Example: for the following 5 rules

    syntax "[" [start] ".." ...
    syntax "[" [start] "," ...
    syntax [from] "={" ...
    syntax [expr] "QED" ...
    syntax "if" [test] ...

previously resulting parser conceptually was

    choice [ try (symbol "[" >> expr >> symbol ".." >> ...)
           , try (symbol "[" >> expr >> symbol "," >> ...)
           , try (expr >> symbol "={" >> ...)
           , try (expr >> symbol "QED" >> ...)
           , try (symbol "if" >> expr >> ...)
           ]

now it conceptually is

    choice [ try (symbol "[" >>
                  choice [ try (expr >>
                                choice [ try (symbol ".." >> ...)
                                       , try (symbol "," >> ...)
                                       ])
                         ])
           , try (expr >>
                  choice [ try (symbol "={" >> ...)
                         , try (symbol "QED" >> ...)
                         ])
           , try (symbol "if" >>
                  choice [ try (expr >> ...)
                         ])
           ]

Profit is in transition between rules 1-2 (and rules 3-4):
if rule 1 fails after `expr` was evaluated it would have
been reevaluated again in the rule 2. Now it wouldn't.
Update CONTRIBUTORS
Just store sorted list of syntax rules
Merge pull request #1729 from projedi/custom-syntax-optimization

Custom syntax optimization