iOS 6.1+ Support

1. Use CoreMotion for accelerometer
2. Support ARC
3. Replace deprecated functions