Mostly finished off Affine

Still want to do boolean optimizations, but that can wait until I
actually, y'know, need them.