Pdgui refactor
This branch adds a small callback-based framework for handling messages from the GUI. It should fix most of the errors we've had with messages arriving from Pd before the relevant window/element exists.
Performance looks about the same as before, so most of these changes should be transparent.
However, there may still be typos in some places, so please test and help me catch them before merging this.