Improve undo history persistency setting

Add global variable to set custom path to save undo history