MuseScore 13/07/2015: Refactoring #2

I refactored and cleaned a lot of code, tested several cases when we connect MuseScore to an external application and change/reassign MIDI channels. Also I fixed a few small bugs.
I think the "Assigning MIDI channels to instruments" feature is almost ready for publishing.