Implement editor history

Review after #182 

* Implemented editor history per-language (fix #179)
* Fix a UI bug wherein old physical plans would keep being displayed