WIP implement history
WIP integrate history with client
WIP separate out protocol implementation