Code cleanup.

Removed some old junk code.
Refactored array generation to make it easier to deal with rowspawn and
colspan later.