Further optimisations and refactoring for the JOCL colormapper.