CORE-4806: Massive refactor of App editor code