Fixed a few instances where arguments weren't passed to to_json()
Added a delete_all_segments interface
Added an interface to clear the undo buffer
Fixed a bug in delete_all_segments() where I forgot to define 'body'