Factor out editor app in to app.py