Improve command palette sorting. Fixes #167.