Completely refactored temperature sensing code. Adding some motion sensor stuff