Suport ND arrays and VariableTrees for residual calculations.
Add support for residuals of ndarray elements connected to scalars.
Merge pull request #1389 from setowns1/bug

Support residuals for 'wide' variables such as arrays and variable trees