Abstract validation logic into separate gem

/cc @arfon, @johndbritton