Revamped canvas history buffering to avoid JSON client max_recv limit problems. Kind of ugly, but I will refine it later.