Create mapper.py

Moved filtering logic from engine.py to mapper.py to allow for multithreading/multiprocessing in the future. Bulk of processing will be performed here.