move shared code to temp_lib; add config option for temperature scale