Updating hierarchies after deleting panels, fix #46

- Updating target panel and applied to properties, if necessary, after deleting panels
- Fixed a few bugs (choosing target panel for the first hierarchy, setting via assocation end for the second one and a few minor ones)
- Some code refactoring