Rewrote portmidi initialization so the ports can be tested.
PortMidi also terminates now.