Parse format strings

- This was nastier than I realized, as the %{ embedded programs %} may
  themselves contain strings and parenthesized sub-expressions.  So we
  have to count opening and closing parens, and musn't get confused by
  those in embedded strings.