Add and use efficient string concatenation functions.

This patch modifies most of the string concatenations that show up in
race.swf and slime.swf as causing more than 1 MiB of allocations.

This subsumes #1593.