Added statistics file, non-optimized writing

I've set up the basic method. Tried some optimization but realised I had no clue what actually is better; I was hoping @festen could take a look at that. Also, writing is not done asychronously yet. It's still really fast I think, so I've left it like this and I'm curious for your feedback.