Refactoring stats add implementation and working on stats.js DocBlock.