OpService: return requested Op with proper type

When asking for an Op of a particular type, it is nice to get back an
object typed according to that class, instead of typed as a general Op.

The only potential danger here is the Optimizer feature, which lets you
replace a Module with a different Module with identical behavior. This
change now enforces that the behavior indeed match with respect to the
object type returned by Module#getDelegateObject(). That is: that object
now needs to be type compatible with the originally requested type.
Function: implement Converter

All functions can function as converters, because they can!
Renamed OutputFactory to BufferedFactory

This clarifies that the factory can produce things other than function
outputs, depending on the circumstance.
Added OutputFunction interface

An OutputFunction is a Function, which can provide the output object on
its own given some input object.
Merge pull request #36 from imagej/output-functions

OutputFunctions
AbstractInplaceFunction: implement Converter method
AbstractOutputFunction: check for null output

Specifically, when compute(in, out) is called, the out might be null.
We want to always handle this case intelligently.
Remove ConvertWithFunction and update classes using it

As each Function is a Converter now, we don't need a special wrapping
mechanism for that anymore. We simply can use any function
to act as a converter.
HistogramCreate: fix computation

In 'HistogramCreate.run' a histogram class is created but the histogram
data does not seem to be generated.  It seems a call to 'countData' is
needed to generate the histogram of the input.

HistogramCreate is made an op so that the thresholding methods can find
it using the op service.
Threshold op now passed to map op

Previously a threshold of type T was passed to the map op.  However the
map needs a function as the third input parameter.
Rename PixThreshold to ApplyThreshold
HistogramCreate: Correct ordering of inputs and outputs

Outputs first!
Otsu: convert threshold from bin to gray level

The threshold is calculated as a bin number, and must be converted to a
gray level.
Refactor GlobalThresholdMethod

It is now an interface that extends Function.

And we can simplify the interface. Not every compute threshold method
needs a histogram; we should make sure that we don't have unnecessary
calculations in ops.
Add global threshold test class

This class is for testing global threshold methods.  The initial commit
has a test for Otsu threshold.  In the future tests can be added for
other global threshold methods.  The Otsu test is structured as follows:

1.  Create a ramp test image.  2.  Threshold using ops and count the
number of foreground pixels.  3.  Convert to IJ1 ImagePlus and threshold
using the ImageProcessor threshold functions 4.  Verify the count
produced by the op is the same as the count produced by ImageJ1.

imglib2-ij was added as a testing scope dependency as it contains the
utilities to convert to IJ1 ImagePlus.
Progress on thresholding API, with Brian
Rename AutoThresholdMethod to ComputeThreshold

We want to differentiate between the layer that _computes_ thresholds,
versus the layer that _applies_ them by iterating over an image.
GlobalThresholder: remove misleading comment
ApplyThreshold: add javadoc TODO reminder
GlobalThresholdTest: use clearer test method name