commit working stuff before I change to always sending Javascript
move message handler to a new module, preparatory to moving to doing everything via transmitted javascript.
moved widget generation to diagrammer.pl
changed to generating javascript