Pull all metric and category data from db, expose

With the notable exception of Metric.long, this removes a lot of
hard-coding (at the cost of some added to ingest).  Exposed to api, but
not used in measures yet.