Added LBRK terminal to template lexer and parser.

Added text non-terminal to template parser to collect TEXT and LBRK
terminals together.  Modified definitions for part and template
non-terminals to keep the parser happy.

Fixed bug in buffer_starts_with() where it incorrectly returned true
when the buffer was shorter than the prefix.

Fixed bugs in various match_X() functions for both template and sitedef
lexers, where the next char in the buffer was examined before checking
that the buffer length was exceeded.