Stats: Clean up sparkline js.

Indent better, add comments and follow `var` declaration conventions.