math: Add MAX and MIN.
Add some sensor-specific code.
Add the magnetometer test.