Clean up metric parsing code.
Rename metric types.