added recursive version of applyProduction
21.1 plus driver, and 21.2 done
21.1: implemented array capacity growth

21.2: driver done
21.5 and 21.6, plus driver done
21.5 and 21.6, plus driver done