Card 180: Create a setting to persist Spade primary sort preference.
Card 180: Convert TreeLayoutMode to CodeSortOrder to simplify code, updating all related references as well.
Card 180: Update Spade logic to synchronize sort order with settings.