Fix for https://github.com/codecombat/codecombat/issues/1099
Initial work on undo/redo using set, insert and delete
Minor fix for saveChanges being called twice
Refactors some code for tracking actions