Refactor and test.

Move the "ArrayRendering" and "Section" functions to the bottom of the source file.
Extract functions from the switch statement that creates renderers.
Resolve bugs introduced with refactoring.