Moves raw data processing logic to another file.
Adds tests