Fixing typos, starting DocBlock for stats.js, and refactoring.