Removed struct template_parse_state.

Also replaced various boilerplate template parser reduce functions with
calls to parser_reduce() and parser_reduce_list().