Added sort functions to Palette.js.