Restructured tempcontroller class to make testing easier
Added initial unit tests