Add some tests of PD, PDDouble
Change signature of mean/var methods, add tests for them.

* Rather than things like getMean(double&), do getMean() returns
  a double for getMean, getMeanAndVar, and the 2D equivalents.
* Add unit tests for those functions, including after logging.