Added support for the accelerometer, checking for taps as well as determining what orientation the accelerometer is in.