Refactored tokenize() into a TemplateParser class.

- Created new TemplateParser class.
- Broke up tokenize() into methods of TemplateParser so there's not one
  giant function.
- Fixed crash with empty statement blocks. An exception is thrown now.

Signed-off-by: Chris Reed <flit@me.com>
Option to elide following newlines and some improvements.

- If the character before the block closing brace sequence ('$}' or '%}')
  is '>', then a newline immediately following the '}' will be elided.
- Changes in TemplateParser methods to support this feature.
- Moved KeywordDef struct definition.
- Replaced strip_comment() with changes to the statement tokenizer to
  handle line comments.
- Added a peek() closure to tokenize_statement() that is used to simplify
  the lexer state machine by adding lookahead. Removed OPERATOR_STATE.
- Added append_string_escape() function and handling of string escape
  sequences in the statement tokenizer state machine.

Signed-off-by: Chris Reed <flit@me.com>