A lot of code was unnecesarily shared between the backends. This places much of that code in a new file, `imgproc.py`