Added preliminary support for swap. Added basic undo functionality.
Added basic support for undo. Added preliminary swap support.