Re-org js scripts.
Minor fix to calculate range for history stats.
Get display stats from today history instead of real time.