Refactor graph code into module graph editor.