cleaned up GroupByScan and added tests
Merge pull request #41 from timbokopter/feature/cleanup_GroupByScan

cleaned up GroupByScan and added tests