Changed temp regulator thread, added better db accessor methods