Always create an empty DOM element for a new gadget.
This reduces the number of DOM modifications (only one replace). This also ensure that the element content is empty. Previous event listener will also be discarded (and so, reduce memory usage). declareGadget element parameter can now also be a tag name.
Showing with 141 additions and 54 deletions