Fix callback return value issue.  Store last validated code from DIGEST callback.  Consolidate common code from vanilla and DIGEST into a single function.