Add the mode param for border management.

I added the possibility to specify the mode parameter to scipy's affine_transform to have more control over border management. 

The only real code change is the addition of the mode param to the resample method and the passing of this mode to the two affine_transform calls. All the other changes are some pep8ifications while I was there.