Adds ability to output every nonlinear and linear iteration

This addresses issue #2617.