Added support for restrict, totals equality in recountPET tests.
Fixed bug with end-of-array reference for marginPET C++ code.
Cleaned up marginPET code, removed unnecessary sort.
Added tests for marginPET.