Refactor validate.sh

This refactors the validate stuff to all run from one script, with
consistent formatting, etc.

(sorry for the original title of this pull req - `hub` has issues..