EMD: encapsulate global variables and functions from original source in a class

To prepare the ground for further reorganization, move global variable and
function declarations to a class. Convert emd() function to a wrapper around
the new class.
Fix warning about unused value.

The return value of the emd() function is not used when testing if an
exception is raised for nonsensical input. Do not store it in a variable to
supress warnings from the compiler.
Fix warning about redefining INFINITY in test/emd/emd.hxx.

Source code imported for Earth Movers Distance (EMD) computation defined
INFINITY. This clashes with the definition in math.h. Removing the
definition in emd.hxx fixes the issue.

Use std::isinf to check if a value is INFINITY instead of plain comparison.
Switch Earth Movers Distance (EMD) algorithm to doubles.

Move to using double instead of float in the emd() function. This step
makes function signatures compatible with the stubs in vigra/emd.hxx
without complicating things by introducing yet another template argument
for the return type.
Implement EMDOptions class and use it to pass EPSILON to emd().

Source code imported for the emd() function uses C preprocessor macros to
determine optional parameters in the algorithm. This patch implements a
class EMDOptions to encapsulate these options and makes the emd()
implementation read the value of EPSILON (error tolerance used for floating
point comparisons) from the new class.
Use options class for maximum number of iterations in emd().

Trivial changes in the Earth Movers Distance (EMD) function to use the
options class EMDOptions to determine maximum number of iterations instead
of the value defined with the preprocessor macro.
Modify emd() functions to use maximum signature size from the options class.

The Earth Movers Distance (EMD) code imported from sources accompanying the
paper hardcodes the data structure size in with a preprocessor macro.
Switch to using the variable in the options class instead. This requires
dynamic memory allocation, for which we perform no error checking in hopes
that the code will be converted to STL/VIGRA data structures at some point.
Move emd code to header file in preparation for templates.

In order to introduce template in the Earth Movers Distance (EMD) code, it
has to be moved to a header file. This patch moves the code and renames the
DEBUG_LEVEL variable to EMD_DEBUG_LEVEL.
Use templates for the feature type in Earth Movers Distance (emd) computation.

The feature type is defined by a hardcoded typedef in the header file for the original emd() source. Use a template to allow different types to be used.
Add example1 from original Earth Movers Distance (EMD) source code.

Now that templates allow using different data structures for the feature
type in emd(), include example1 from the original code.
Fix compiler warnings in imported emd() code.

GCC complains about uninitialized variables in the emd() code imported from

http://robotics.stanford.edu/~rubner/emd/default.htm
Implement a Signature class for use in Earth Movers Distance (EMD) functions.

This patch replaces the signature_t C struct defined in the source code
imported for emd() with a Signature class, freeing us from memory
management trouble and handle printing and random generation better.
Use a class to store flow for Earth Movers Distance (EMD) computation.

Instead of a c-array for pointers to struct {to, from, amount} use a class
EMDFlow defined in vigra/emd.hxx.