Several bug fixes and added scaling target.

Fixed bug in difference mode of profilex.
Fixed sense of positive and negative images with
respect to scaling and buoyancy in difference mode.
The negative image is now the reference image
and the positive image is buoyant.
Also allowed selection of scaling target
for difference mode: background or simple.
Updated test/example profile.cfg file accordingly.
Finally, fixed plotting bug where averaged patterns
were not smoothed in the plot if they were scaled.