Make Json/XML messages use parse tree more directly, other minor tweaks