Moving around some stuff

Moved functions for residual calculation up to the parent (SequentialFlow) so that all of the useful workflows can make use of it.