Add new-style test generation for SUM and PRODUCT

Intermediate commit, still a bit buggy.

Also, bin the old code that was ifdeffed out.

Change-Id: I747c1864e4858672f0fe0512215405885e52c3b5