Separated extraction of records from db into a separate function
made generic input/output file checkers
minor edits
few changes to pipeline test script