Refactoring, fix broken export.

1) Move editor code to spark_window.
2) Move Other UI code (run/export button) to spark_window.
3) fix broken export.