Use Array.join() to build up strings in more places.

This patch was in #4330, but I deleted that pull request.