implemented groupBy, along with documentation and tests. Addresses issue #214