D7579 is a minimal refactor to allow D7580 to be merged.
TODO: finish plucking the pruning/disk access related code out of validation.cpp into its own module.