Editor: avoid name clash
Cleanup: readability
Cleanup: removed dead param
Editor: made messages more flexible

Not that I'm proud of this but the box needs to be adaptable to display
the close button conditionally.
Cleanup: minor reorganization
Editor: prevent working on units from obsolete stores

Fixes #3322.