gitstats: Refactoring, cleanups and documentation