Temperature conversion code

Fully split out to use conversion functions etc.