Enhanced constant folding of format().

Because the general case is a PITA, we had been tackling it on a case-by-case
basis, and in fact previously only folded the "%s" case. Extend this to
constant fold "%d", "%s%d", "%s%s", "%d%d", and "%s%d%d" cases.
Enhanced simplification of compassign, mxcompassign, and aassign.

Consider this idiom:
    color C;
    C[0] = 3.14;
    C[1] = 0;
    C[2] = 42.0;

We track constant-ness by whole-symbol, not by individual component of
aggregates (like colors or points or arrays). So previously, this code
would result in element-by-element assignment of the color, which even
then would not be recognized as a constant.

(N.B. That looks like silly code compared to "C = color(3.14,0,42)", but
in fact people do this kind of nonsense, and even if they didn't, they
might be assigning *non-constant* things that, only part way through
optimization, are all turned into constants.)

With this patch, we recognize consecutive component assignment to the
same aggregate, and if ALL components get assigned constants, we can
replace the whole code sequence with just a single assignment from a
constant aggregate, which in all likelihood will lead to the later
elision of the variable altogether.

This applies to compassign (component assignment to triples),
mxcompassign (component assignment to matrices), and aassign (individual
element assignment to arrays).
More enhanced constant folding of format()

Instead of a small number of specific cased ("%s", "%s%d", etc.), now
we loop over the arguments, back to front, peeling each one off and
formatting it into the format string itself, until there are no more
constant-valued arguments at the end. If we've exhaused all arguments by
the time we're done, the format goes away entirely and we just have a
string assignment.

To illustrate,
    format ("%s %g (%g)", "blah", 42.0, point(1,2,3))
turns into the constant string "blah 42 (1 2 3)", and
    format ("%s %g (%g)", "blah", u, point(1,2,3))
would at least simplify to
    format ("%s %g (1 2 3)", "blah", u)

Most of the interesting cases are the first category (complete formatting),
but at least in the partial-formatting case it's a little bit simpler.