Modified the source to implement more of the server-side protocol.
Some very minor tweaks have also been inserted throughout the code.
UNTESTED with the latest participant client.