Simple key signature detection algorithm

Works surprisingly well on the most of MIDI files. Correct accidentals - more clean resulting score.