Calibration of rotated board

Continuation of https://github.com/PX4/Firmware/pull/481

- Accelerometer calibration of cotated board fixed
- Rotation code moved to lib/

Not for merging yet, TODO:
- Magnetometer calibration