refactor out data quality tests into separate javascript module