Refactoring.

* Extracting class: Grid is now an own component extending dataGridView.
* Creating class for der undo and redo stack.
* Removing redundancies.