Support array in replacement as well.
Implement Section 2, part 6.

I also added all the comments from the spec and set up the rest of section 2.