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)

- Fixed Debug Mode -> Edit Mode transitions
- Cannot add new nodes/edges in debug mode now.
- Added color API in editor and using it to show vertex violations
- Refactored some editor code to improve re-usability.