Initial changes to use unitsofmeasurement library

Only part compiles so far.