group/count results in SQL instead of in code. Fixes #10
Merge pull request #11 from aaronpk/master

group/count results in SQL instead of in code. Fixes #10