Format cleanup and so on for scaling filter.

There's a lot here.  It all should be a noop.  Tests pass.  There are some changes for efficiency and to make less code, but most if formatting.

(I was mostly trying to figure out how we're doing things.)