refactored ImProcessor and reduction.py

it will make things simpler if we split up the different
passes into different modules, classes because they don't have
a lot of similarities with each other