Added etl class, refactored code, fixed unit tests