Music theory updates

(These are the same changes I sent you in the email earlier.) They allow other key signatures, and enable proper handling of accidentals.