factor serialization into ser.go. Server state saved at each heartbeat. atg.