Factor out and polish counter, gauge, and label serving.

Hi Johan,

this is just a bit of polishing that I happened to do while trying out an approach to separate the monitor routes from the assets serving. It includes one change in the semantics of these routes. Namely, that handlers are no longer triggered by a prefix of their path, i.e., the handler for `GET application/json combined` will no longer handle `GET application/json combined/foo`.