Complete implementing the algorithm and unit tests.  Refs #6904.