Using sudden motion sensor as accelerometer on OSX

This pr is now complete.
~~This is still under development. But I am creating a PR for easy reference.~~