reworked the accelerometer function

Got rid of the less reliable setInterval/clearInterval and switched to
the watchAcceleration/clearAcceleration