do not reference undo/redo directly, as it appears that they may not exist until the Doc is created. Instead, wrap them in thunks that are called at runtime