fix est/day calculation
minor updates to variable names for improved readability
some js functions abstracted out of user_stats
incremental js cleaning