Refactoring, added XYZ to RGB conversion. Updated tests.