Integrated MidiListener into Environment.

Cleaned up codebase.