Maintain an operation log to better keep clients in sync

Major reorganization of the socket transport code to separate "stateful" changes from ephemeral changes, and to maintain a log of stateful changes so that clients can be caught up if there is a gap between page request and socket connection.