Issue #2234911 by John Franklin: refactor the submit handler so we can use a pure submisison handler with drush or actions.