Implement LimitStack to prevent undo overflow

Signed-off-by: Harsh Gupta <gupta.harsh96@gmail.com>
came case is preferred over snake case in JS