Refactoring editor code, stabilising debugger and fixing issues and adding the coloring for vertex violations

![screenshot from 2014-05-15 05 38 42](https://cloud.githubusercontent.com/assets/514557/2984073/48f53236-dc2e-11e3-92b5-1b000aa515c0.png)