as_dict works for Metric for real.
move todict() function from views to util
move dict_from_dir function into util.
fix metric.is_highly(), flatten percentiles.