Found out that our code was bugged due to performing two flip affine transforms in series. Also cleaned up some other messy things.  Fixes #29.