Templated the C++, fixed python unit tests.

Changed C++ to use a template for the data type (we might want ints,
doubles, etc.) Forced python version to convert even int types to double
to avoid templating problems with cython. Fixed the unittests to not
exit after first test (exit=False) so all variants actually get tested
now.