Stream stats calculation

With this change, stats load on Heroku with the windshield survey (~28,000 results). @prashtx, can you test with your huge survey? Any obvious memory leaks here?