Repositioned the slice function within the code
Shortened the hasKey function by using _.all
Repositioned the manipulateUndoType function
Documented the code by using JSDoc