mod_admin_stats: major refactoring, introducing chart factories.

Also moved somewhat generic parts into z_charts.js for future break out
into a generic chart module.