As noted by @Ricordisamoa on Wikitech-l:
My implementation uses PopupWidget for the tooltips, which are automatically adjusted according to the anchor's position, while a subclass of ProcessDialog handles the user configuration.
Unfortunately, it doesn't comply with the design specs, but on the other hand its operation is very similar to the English Wikipedia gadget (now found on many language editions from where I've imported translations) and is customizable to a fair extent.
Using the PopupWidget will reduce a lot of rendering code. The current structure should also move to using OOjs.