(bug 43958) fix autocomment for connecting an item with a client page

- this also generally polishes up this bit of code, although
still @todo better integration with the change handling and polling

Change-Id: I334d4e09137cf12b1d207a8651726d5e1cd1b586