Fixed XYZ to RGB and back problems. Pushed reference white matrix into the mix. Cleaned up some calculations, e.g., made sure to keep the signed bit.