add calculation of stats on results
add bson reader and writer for stats
Merge branch 'feature/stats' into develop