Reduced dependence on PendingCommandState in general, among others in
connection.
Added support for forwarding undo/redo.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>