Refactor the worker and main code to follow the logic for choosing whether to use quantizer or dithering as defined in README
Be somewhat lenient with somewhat faulty palettes - so the library is easy to use
No need to check for palette length in the worker-it's sanitised before it reaches there