Refactor driver to allow collecting statistics without actually writting output. Add some docs.