tests: test single-line groups
new operation: countunique
tests: add countunique tests
calc: fix memory problems
tests: add valgrind tests
tests: fix valgrind test for 'make distcheck'