Added scripts used for refactor and refactored db:tests from db_records