syncstring: refactor and improve some code in prep for improving robustness on reconnect
syncstring: refactor and improve some code in prep for improving robustness on reconnect

DrXyzzy/smc,tscholl2/smc,tscholl2/smc,tscholl2/smc,sagemathinc/smc,DrXyzzy/smc,sagemathinc/smc,DrXyzzy/smc,sagemathinc/smc,sagemathinc/smc,tscholl2/smc,DrXyzzy/smc,tscholl2/smc