ENH: Generalize feature-finding to any n-dimensional images.

WIP: 2D nearly passes -- still needs iteration loop in refine

WIP: passes on non-noisy data, still need loop

WIP: passes on non-noisy data, still need loop

WIP: 2D seems fine now

WIP: rolled back feature

WIP: squeeze image

WIP: 2D passes and 1D works too.

CLN pyflakes

WIP: more cleanup and a crucial wrong-variable bug