Improve magit-section-case and related functions