Remove unused variables.
Clean up some MIDI code.
Use memento_command_binder() to (probably) fix MSVC build and other things.

Remove ugly hack that does the same thing.