Added UndoController, which is capable of undoing any action we can
currently support. Updated a lot to make it work and did some
refactoring along the way. Fixed some bugs in ConnectWordController and
DisconnectWordController which occurred if there was only a small space
between the previous and new locations.