Refactor valid? and process

Also refactored avalon lib/avalon/batch_ingest.rb.