Maintain list of tasks sorted for AddCommand and EditCommand