statistics: added JSON output to the stat tool

So you can write your own stuff. Because I'm that nice :)