Rework some EventCmd internal JS rendering logic. Improve event editing dialog, enable insertion.