Adds ability to output every nonlinear and linear iterations

This addresses issue #2617.