One trick here is the ambiguity that, for example, C6 looks the same
as Am7 in first inversion and Cm7 looks the same as D#6 in 3rd
inversion. We rework the recognition code a bit so that chords with a
smaller inversion number will be preferred over chords with a larger
inversion number. That way, with the above examples, scherzo will
report C6 and Cm7 rather than "Am7 1st inversion" and "D#6 3rd
inversion".