MADS: Cleanup of palette code, updated old-style 4 byte RGB usage to 3 bytes