refactoring.
Refactoring a lot, toolbar for Python repl.