[23] Implemented edit fields fill according to selected item in treeview.

* Fixed command items being overwritten on load.
* Fixed race condition crash on application close.
* Other minor bugfixes.