Measurements (was #30).

There's a lot of logic in this function; I am not sure about OCaml style but in other languages I would expect some of this logic to be factored out into separate functions. For example, loading, formatting, and filtering the list of measurements could be done with library functions, and the prefix matching logic would be clearer as library code.