cupid: fix error when findclumps with jsacat finds 0 clumps.

The section of code that copies history etc. from the input to the
output JSACAT was not checking that nclumps was 0, and therefore
produced an error when no clumps where found. This fix checks that
nclumps evaluates to True before it copies anything in.
cupid: extractclumps now supports the SHAPE parameter

Also the jsacat will be more similar to that produced by
findclumps, the output now supports QUALITY=EDGE and cupid
copys the history into the jsacat.