Design a document layer that supports applying operations and undoing them efficiently. Extend the design to support commit-batch functionality and optimize batch undo. How would you add redo capability to the document layer while maintaining performance guarantees?