Add Kalman filtering to gyroscope mode.

Enable gyro again, Make share activity synchronous.
Code clean up.