webperf: refactor navtiming.py

This script grew like a wild weed. In this patch I try to rewrite the ad-hoc
metric processing into something vaguely generic.

Change-Id: I89372aa69ec2c926ba2910d435031da0bad54eb8