Add tests for groupByNode()

Fixes #24