[WIP] Compute relative residuals as well as absolute residuals.

Needs tests.