Refactoring: extract graph classes and clean code.
Fix codegeneration for array elements.
Add ToDo for the future.