SCUBA2: new primitive to threshold an image using statistical criteria

This primitive can threshold an image based on a multiple of the
exposure time, variance or error components.

The threshold multiplier, estimator and component can all be specified
by recipe parameters.
PICARD: add support for thresholding images using statistical criteria

The recipe parameters CROP_METHOD, STATS_COMP, STATS_ESTIMATOR, and
STATS_THRESH control how the image may be thresholded using the
exposure time or variance/error components.
SCUBA2: use new primitive to apply threshold

The old thresholding code now forms the basis of the new
_THRESHOLD_IMAGE_ primitive.